View Single Post
Old 11-12-2004, 09:55 AM   #1 (permalink)
Lord Humungus
Addict
 
Lord Humungus's Avatar
 
Location: The Outer rim of HELL
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.
__________________
I am still searching for the movie this quote was in...
"Make you strong, like bull", said in a russian accent
Post here if you know anything...PLEASE!

Last edited by Lord Humungus; 11-12-2004 at 10:11 AM..
Lord Humungus is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62