pankaj pareek
Wednesday, April 24, 2013
How to use table name in dymanic query
Declare @tableName VARCHAR(100), @SQLString NVARCHAR(MAX) SET @tableName ='employee' SELECT @SQLString ='Select * from ' + QuoteName(@tableName) EXEC @SQLString
How to get max record from each department SQL SERVER
with cte as ( select *, rank() over (partition by User_Name order by Start_Timestamp desc) as [r] from AUDIT_EVENT ) select User_Name,Start_Timestamp from cte where [r] = 1;
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)