troubleshooting Question

Paginate with SQL Server 2005 using ROW_NUMBER()

Avatar of joethermal
joethermal asked on
Microsoft SQL Server 2005PHP
7 Comments1 Solution360 ViewsLast Modified:
Hi, I would like to paginate a query that has a join ...I can get row numbers with ROW_NUMBER() with a single table like this...(image attached)

             FROM (SELECT ROW_NUMBER() OVER(ORDER BY order_no) AS
       rownum,order_no, supplier,product FROM scheme.inwards_goods) AS standard

but have been unable to do it on the query below (which has a join)

can anyone help... select.tiff
FROM scheme.inwards_goods ig WITH (READUNCOMMITTED)
LEFT OUTER JOIN scheme.stockm st WITH (READUNCOMMITTED) ON (ig.product = st.product)
 WHERE  ig.warehouse !='dd' 
 AND ig.warehouse !='d' 
 AND ig.warehouse !='dx'
 ORDER BY ig.date_entered DESC
Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros