Webboy2008
asked on
sql / asp
I have the following SQL query. Query 1 is working fine.
and I tried to modify to get particular rownumber like query 2.
it alerts me error in sql server.
Can experts help me to fix query 2 and tell me what's wrong?
I used this query for website, like asp
Thanks
Query 1:
Select PartNo,
Row_Number() Over(Order By PartNo) rownumber,
Count(*) Over() as TotalRecordCount
From Products
where Category = 'COOLANT'
Order By partno asc
Query 2:
Select PartNo,
Row_Number() Over(Order By PartNo) as rownumber,
Count(*) Over() as TotalRecordCount
From Products
where Category = 'COOLANT' and rownumber = 1
Order By partno asc
and I tried to modify to get particular rownumber like query 2.
it alerts me error in sql server.
Can experts help me to fix query 2 and tell me what's wrong?
I used this query for website, like asp
Thanks
Query 1:
Select PartNo,
Row_Number() Over(Order By PartNo) rownumber,
Count(*) Over() as TotalRecordCount
From Products
where Category = 'COOLANT'
Order By partno asc
Query 2:
Select PartNo,
Row_Number() Over(Order By PartNo) as rownumber,
Count(*) Over() as TotalRecordCount
From Products
where Category = 'COOLANT' and rownumber = 1
Order By partno asc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.