Viewing 5 posts - 1 through 5 (of 5 total)
Sometime tells me Microsoft does not even want you creating temporary views.
CREATE VIEW #TestView AS (
SELECT 1 as a
)
Returns
Msg 4103, Level 15, State 1, Line 1
"#TestView": Temporary views are not...
August 28, 2015 at 12:27 pm
Forgot the entity chunk. Yes you will need a CTE and a Row_Number function.
[Code]
DECLARE @EntityID INT = 123;
WITH cte
AS (
SELECT row_Number() OVER (ORDER BY Audit_ID) AS RN
...
April 11, 2013 at 12:26 pm
You were on the right track with the self join
SELECT t1.ActionDate, t1.Field_B
FROM #test t1
LEFT JOIN #test t2 ON t1.Audit_ID = t2.Audit_ID-1
WHERE t1.Field_B != t2.Field_B OR t2.Audit_ID IS NULL
April 11, 2013 at 12:05 pm
Something like this should work for you
SELECT c1.CompanyName
,c1.CompanyID
,c1.Heirarchy
,c2.CompanyName
FROM Company c1
LEFT JOIN Company c2 ON c1.parentCompanyID = c2.CompanyID
April 11, 2013 at 11:55 am
Is there a reason you cant do SELECT p.name FROM sys.procedures p
?
April 10, 2013 at 11:16 am
Viewing 5 posts - 1 through 5 (of 5 total)