Paging with SQL Server


 

SELECT * FROM (
SELECT ID_PRODUK,NAMA_PRODUK_FULL, TOTAL_ROWS=Count(*) OVER(), ROW_NUMBER() OVER(ORDER BY id_PRODUK) AS ROW_NUM
FROM TB_PRODUK
) T1
WHERE ROW_NUM BETWEEN 1 AND 50

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: