This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 4338
    
    7

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?
 
Similar Threads
What value does readLine() return when it has reached the end of a file
WA #1.....word association
object reference variables as literals?
To Bert Bates and other authors too - please consider this request