Jump to content

Archived

This topic is now archived and is closed to further replies.

Gmunky

I need help with I think should be a pretty simple query.

Recommended Posts

How do i write a query that outputs all the records when a specified attribute is null?
for instance, if the table looks like this:
_______________________
studentID | phone            |
--------------------------|
1          |111-111-1111  |     
2          |222-222-2222  |
3          |                      |
4          |                      |
---------------------------

I want to output all the studentIDs with no phone numbers.

i tried SELECT studentID WHERE phone is NULL; but i get an empty set.
Thanks for all your help!

Share this post


Link to post
Share on other sites
[quote author=Gmunky link=topic=107792.msg432824#msg432824 date=1158076787]
ok. how about if I want to output the studentID's that are NOT null?
[/quote]
select studentID from table where studentID != ''

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.