메뉴 닫기

SQL IS NULL Clause

The SQL WHERE IS NULL syntax

The general syntax is:

  1. SELECT columnnames
  2. FROM tablename
  3. WHERE columnname IS NULL

The general not null syntax is:

  1. SELECT columnnames
  2. FROM tablename
  3. WHERE columnname IS NOT NULL

SQL WHERE IS NULL Examples

Problem: List all suppliers that have no fax number

  1. SELECT Id, CompanyName, Phone, Fax
  2. FROM Supplier
  3. WHERE Fax IS NULL

Results: 16 records

Id CompanyName Phone Fax
1 Exotic Liquids (171) 555-2222 NULL
2 New Orleans Cajun Delights (100) 555-4822 NULL
4 Tokyo Traders (03) 3555-5011 NULL
5 Cooperativa de Quesos ‘Las Cabras’ (98) 598 76 54 NULL
6 Mayumi’s (06) 431-7877 NULL

Problem: List all suppliers that do have a fax number

  1. SELECT Id, CompanyName, Phone, Fax
  2. FROM Supplier
  3. WHERE Fax IS NOT NULL

Results: 13 records

Id CompanyName Phone Fax
3 Grandma Kelly’s Homestead (313) 555-5735 (313) 555-3349
7 Pavlova, Ltd. (03) 444-2343 (03) 444-6588
9 PB Knäckebröd AB 031-987 65 43 031-987 65 91
13 Nord-Ost-Fisch Handelsgesellschaft mbH (04721) 8713 (04721) 8714
14 Formaggi Fortini s.r.l. (0544) 60323 (0544) 60603
18 Aux joyeux ecclésiastiques (1) 03.83.00.68 (1) 03.83.00.62
19 New England Seafood Cannery (617) 555-3267 (617) 555-3389
21 Lyngbysild 43844108 43844115
22 Zaanse Snoepfabriek (12345) 1212 (12345) 1210
24 G’day, Mate (02) 555-5914 (02) 555-4873
26 Pasta Buttini s.r.l. (089) 6547665 (089) 6547667
28 Gai pâturage 38.76.98.06 38.76.98.58
29 Forêts d’érables (514) 555-2955 (514) 555-2921

37 Comments

  1. g even

    Thanks a lot for sharing this with all of us you actually realize what you’re talking about!
    Bookmarked. Kindly additionally talk over with my web site =).

    We could have a link trade arrangement among us

  2. tinyurl.com

    Hey I know this is off topic but I was wondering if you knew of any widgets I
    could add to my blog that automatically tweet my
    newest twitter updates. I’ve been looking for a plug-in like this for quite some
    time and was hoping maybe you would have some experience with something like
    this. Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

  3. Caron Town

    I simply want to say I am very new to blogging and absolutely enjoyed this web blog. Almost certainly I’m going to bookmark your blog post . You definitely come with amazing writings. Cheers for sharing your website page.

  4. our website

    Can I simply claim what an alleviation to find somebody that in fact understands what theyre talking about on the net. You absolutely recognize exactly how to bring an issue to light and also make it important. Even more people require to read this and understand this side of the story. I cant think youre not more prominent since you most definitely have the present.

  5. web hosting company

    Hi just wanted to give you a brief heads up and let you know a few of the pictures aren’t
    loading properly. I’m not sure why but I think
    its a linking issue. I’ve tried it in two different web browsers and both show the same results.

  6. cbd capsules

    There are certainly a lot of details like that to think about. That is a great point to raise. I provide the thoughts over as general inspiration yet plainly there are concerns like the one you bring up where the most important thing will certainly be working in truthful good faith. I don?t recognize if best techniques have arised around things like that, however I am sure that your job is clearly recognized as a level playing field. Both boys and also ladies really feel the impact of simply a moment?s satisfaction, for the rest of their lives.

  7. recommended you read

    Youre so amazing! I don’t suppose Ive check out anything like this prior to. So nice to find someone with some initial ideas on this subject. realy thank you for beginning this up. this internet site is something that is needed online, a person with a little creativity. useful job for bringing something brand-new to the web!

  8. advice

    There are certainly a lot of details like that to consider. That is a wonderful indicate raise. I use the thoughts over as general motivation however clearly there are concerns like the one you bring up where one of the most crucial thing will be operating in sincere good faith. I don?t know if ideal techniques have actually arised around points like that, however I make certain that your work is clearly recognized as an up for grabs. Both boys as well as girls feel the effect of simply a moment?s satisfaction, for the rest of their lives.

  9. knowing it

    A fascinating discussion deserves remark. I believe that you need to compose a lot more on this subject, it might not be a taboo subject however generally individuals are inadequate to speak on such subjects. To the next. Thanks

  10. experienced

    I?m pleased, I must say. Actually hardly ever do I experience a blog site that?s both educative as well as enjoyable, and let me inform you, you have struck the nail on the head. Your idea is impressive; the problem is something that inadequate people are talking intelligently around. I am extremely pleased that I stumbled across this in my search for something connecting to this.

  11. find out here

    An excellent share, I simply provided this onto a colleague who was doing a little analysis on this. As well as he actually got me breakfast because I found it for him. smile. So let me reword that: Thnx for the treat! Yet yeah Thnkx for spending the moment to discuss this, I feel highly regarding it and like learning more on this subject. Ideally, as you end up being expertise, would certainly you mind updating your blog with even more information? It is very handy for me. Large thumb up for this blog post!

  12. Continue Reading

    An excellent share, I simply provided this onto a coworker who was doing a little evaluation on this. And he in fact acquired me breakfast due to the fact that I found it for him. smile. So let me reword that: Thnx for the reward! Yet yeah Thnkx for spending the moment to discuss this, I really feel strongly concerning it as well as love learning more on this topic. Ideally, as you come to be knowledge, would certainly you mind upgrading your blog with even more information? It is highly helpful for me. Large thumb up for this post!

  13. my link

    I?d need to contact you below. Which is not something I usually do! I delight in reviewing a message that will certainly make individuals think. Likewise, many thanks for allowing me to comment!

댓글 남기기

이메일은 공개되지 않습니다.