How to create a blank/empty column with SELECT query in oracle?

user3878988 picture user3878988 · Aug 2, 2016 · Viewed 102.9k times · Source

I want to generate an output with blank/empty column with a "Select" query in oracle. I'm able to achieve this with below sql query:

SELECT CustomerName AS Customer, "" AS Contact 
FROM Customers;

So when I run above sql query it returns a table with two columns "Customer" column with content in it and "Contact" column with no content or blank column. I want to achieve same with oracle query. Any help will be highly appreciated.

Answer

scaisEdge picture scaisEdge · Aug 2, 2016

I think you should use null

SELECT CustomerName AS Customer, null AS Contact 
FROM Customers;

And Remember that Oracle

treats a character value with a length of zero as null.