SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Returning "NOT NULL" set
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cronincoder
Yak Posting Veteran

56 Posts

Posted - 02/07/2006 :  05:48:56  Show Profile  Reply with Quote
I am trying to select from a column which contains some null entries, and return only those results which are "not null". Can anyone give me some idea, as I am not having any success.


Table Users

UserID
1111
2222

4444
5555

6666


select UserID
from Users
where ??


So in this example above, I want to return just(1111,2222,4444,5555,6666), and not have the two blank spaces included in the results.

Edited by - cronincoder on 02/07/2006 05:49:38

Frank Kalis
Constraint Violating Yak Guru

Switzerland
413 Posts

Posted - 02/07/2006 :  05:56:13  Show Profile  Visit Frank Kalis's Homepage  Reply with Quote

WHERE UserID IS NOT NULL



--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
Heute schon gebloggt? http://www.insidesql.de/blogs
Go to Top of Page

madhivanan
Premature Yak Congratulator

India
22754 Posts

Posted - 02/07/2006 :  09:57:26  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
>>the two blank spaces included in the results.
If you meant them blank than Null then

WHERE Isnull(UserID,'')<>''

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000