I've Just started using MS SQL 2000 with MS Access 2000. I can select
the first 10 products like this :-
SELECT top 10 dbo_products.ProductName
FROM dbo_Product
ORDER BY dbo_Product.ProductName DESC;
But when the user wants the next 10, products 11-20 and then maybe
products 21-30. How do i select them?http://www.aspfaq.com/show.asp?id=2120
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"MaD Matt" <matt@.REMOVEMEworkforcedirect.com> wrote in message
news:i9soh1hlrreb0012ri13kgf4i4a1rv8irm@.
4ax.com...
> I've Just started using MS SQL 2000 with MS Access 2000. I can select
> the first 10 products like this :-
> SELECT top 10 dbo_products.ProductName
> FROM dbo_Product
> ORDER BY dbo_Product.ProductName DESC;
> But when the user wants the next 10, products 11-20 and then maybe
> products 21-30. How do i select them?
>|||Mad
drop table #w
create table #w
(
col1 int identity,
col2 varchar(2)
)
insert into #w values ('y')--do it within a loop
select * from #w
select col1 from
(select top 10 col1
from
(select top 20 col1 from #w order by col1 ASc)AS F
order by col1 DESC) as t1
order by col1 asc
"MaD Matt" <matt@.REMOVEMEworkforcedirect.com> wrote in message
news:i9soh1hlrreb0012ri13kgf4i4a1rv8irm@.
4ax.com...
> I've Just started using MS SQL 2000 with MS Access 2000. I can select
> the first 10 products like this :-
> SELECT top 10 dbo_products.ProductName
> FROM dbo_Product
> ORDER BY dbo_Product.ProductName DESC;
> But when the user wants the next 10, products 11-20 and then maybe
> products 21-30. How do i select them?
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment