Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's the significance of having null as a column ouput all nulls in SQL?

 
vinayak jog
Ranch Hand
Posts: 83
MySQL Database Netbeans IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple query

select column_name, null from table_name;

what is the use of null here ?
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's going to put a column in the output containing all nulls.

Pretty pointless by itself, but there may be cases where it's useful in conjunction with some other constructions. For example:
INSERT INTO ....
SELECT column_name, null
...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic