Use the following code in SQL Server
ตัวอย่าง Select Record Number มาด้วย
select rank() OVER (ORDER BY a.au_lname, a.au_fname) as rank, a.au_lname, a.au_fname
from authors a
order by rank
ตัวอย่าง Select Record Count มาด้วย
SELECT my_table.my_col, count(*) OVER() AS 'Count'
FROM my_table
WHERE my_table.foo = 'bar'
No comments:
Post a Comment