aspose file tools*
The moose likes JDBC and the fly likes What's the significance of having null as a column ouput all nulls in SQL? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "What Watch "What New topic
Author

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

vinayak jog
Ranch Hand

Joined: Apr 01, 2011
Posts: 81

Simple query

select column_name, null from table_name;

what is the use of null here ?
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4366
    
    8

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
...
 
 
subject: What's the significance of having null as a column ouput all nulls in SQL?