simple MS SQL queries
hey gang...need a little help.
I'm trying to do a limit query. I'm familiar with mySQL but apparently MS SQL is a little different.
SELECT TOP 10
id,name,comments
FROM users
WHERE comments != 'NULL'
I know this doesn't work. How do I get this to work? Its the "not equal to blank" im trying to figure out. I want to query out the top 10 records where comments is not blank. Eventually, i want to make a "next 10 records" and "previous 10 records".
edit: im also trying this but its not working
select * from (
select top 10 id,name,comments (
select top 30 id,name,comments
from users
order by comments asc
) as newtbl order by comments desc
) as newtbl2 order by comments asc
msSQL sucks my ass.
Last edited by Lord Humungus; 11-12-2004 at 10:11 AM..
|