all groups > sql server programming > june 2004 >
You're in the

sql server programming

group:

SQL WHERE clause on text field


SQL WHERE clause on text field mongphong28 NO[at]SPAM yahoo.com.au
6/1/2004 11:58:59 PM
sql server programming: Hi,

This may be a simple question but can someone please tell me if/how I
can do the following:

SELECT TOP 10 Id, Name, Address FROM People WHERE Name > 'ADAM' ORDER
BY Name

The example scenario is a table with say 100 records of people ordered
by Id. I want to order by Name and grab 10 records at a time, so
'ADAM' in the above example would be substituted for the 10th name in
the previously grabbed records and so the query would return the next
10 in Name order.

Can this be done with a query or is it more complicated than that?

Thanks for any help,

Re: SQL WHERE clause on text field Uri Dimant
6/2/2004 10:19:20 AM
Mong
See if it helps you, if it isn't please post expected result
CREATE TABLE Test
(
[id] INT NOT NULL PRIMARY KEY,
[name]VARCHAR (50) NOT NULL
)
GO
INSERT INTO Test VALUES (1,'Adam')
INSERT INTO Test VALUES (2,'Adi')
INSERT INTO Test VALUES (3,'Greg')
INSERT INTO Test VALUES (4,'Gery')
INSERT INTO Test VALUES (5,'Tibor')
INSERT INTO Test VALUES (6,'Tina')
INSERT INTO Test VALUES (7,'Albert')
GO
SELECT * FROM Test ORDER BY [Name]


[quoted text, click to view]

Re: SQL WHERE clause on text field Vishal Parkar
6/2/2004 12:31:55 PM
can you post sample example. what you are looking for.

--
Vishal Parkar
vgparkar@yahoo.co.in | vgparkar@hotmail.com

AddThis Social Bookmark Button