Using Row_number() Over(partition By..) Along With Declaring Local Variables
I have a sql query, in this sql query I want to select distinct columns irrespective of column first. For other sql query I use Row_number() OVER(partition BY..) and I also need to
Solution 1:
SET @sql = 'SELECT ' + @columns + ' ,AnotherTable.beam_current, RowNumber() Over(Partition By SomeColumn Order By SomeColumn) AS Rn
FROM dbo.TableName join AnotherTable on TableName.SomeColumn = AnotherTable.SomeColumn
WHERE logtime BETWEEN ''2014-10-10 07:17:00'' AND ''2014-10-10 08:47:00'''
I solved it by this sql query with the help from Giorgi
Post a Comment for "Using Row_number() Over(partition By..) Along With Declaring Local Variables"