tags:

views:

166

answers:

3

Is there a way i can do a SELECT and tell it to return 3 columns and a dummy empty column ? I need 4 columns and the 3rd must be '' until the table is somewhere in the database. I am not allowed to add any columns to any tables.

+5  A: 
Select column1, column2, 'waiting for table' as dummy_column, column4
from your_table
Sean Vieira
That column won't be empty will it? Won't it be filled with "waiting for table'?
Chris Dunaway
Yes, that it will.
Sean Vieira
+3  A: 
mysql> SELECT '' AS empty_col;
+-----------+
| empty_col |
+-----------+
|           |
+-----------+
1 row in set (0.00 sec)
Dan Carley
+2  A: 

Use for a column with empty string

Select column1, column2, '' as dummy_col, column 4 
  from your_table

or for a column with a Null value

Select column1, column2, Null as dummy_col, column 4 
  from your_table
SeriousCallersOnly