ERROR
Database
4
Posts
2
Posters
0
Views
1
Watching
-
Hi all, Select distinct(Mobile), ROW_NUMBER() OVER(PARTITION BY mobile ORDER BY dateofcall DESC ) AS 'RowNumber' from Call having RowNumber=1 Error Invalid coulmn RowNumber Can any one advice please? Thank you
-
The columname-alias "RowNumber" can only be used in a
ORDER BY
clause. Try this one;SELECT TOP 1
distinct(Mobile), ROW_NUMBER() OVER(PARTITION BY mobile ORDER BY dateofcall DESC ) AS 'RowNumber' from CallI are troll :)
-
top 1 returns one record.what i want is to select only those that has a first entry to my database.RowNumber=1