Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 problem viewing records having a NULL value

Author  Topic 

newman
Starting Member

7 Posts

Posted - 2005-08-27 : 08:19:38
hello friends!

i am new to sql and practicing on query analyzer

here is the practice table(test) i have ...

id | names| skill | city|
101| roy | welder | yuba|
102| peter | NULL | yuba|
103| alex | plumber | yuba |
104| edward | NULL | yuba|
105| smith | carpenter| yuba|


Now my problem is i want to see only those records which has skill = NULL..

I tried this stupid query ...

select * from test where skill = NULL

with this it is only showing me all the columns of my table

is there any query for my problem??

also

Is there any single query in query analyzer with which i can delete all the records having skill = NULL ?

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-08-27 : 08:25:52
select * from test where skill IS NULL

Avoid NULLS, it's a special case You will always have to code around, all the way to the UI.


rockmoose
Go to Top of Page

newman
Starting Member

7 Posts

Posted - 2005-08-27 : 08:39:04
ThankYou rockmoose
Go to Top of Page

rockmoose
SQL Natt Alfen

3279 Posts

Posted - 2005-08-27 : 09:17:02
quote:
Originally posted by newman

ThankYou rockmoose



Welcome to SqlTeam newman!

rockmoose
Go to Top of Page
   

- Advertisement -