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
2009-10-08 16:55:52
That column won't be empty will it? Won't it be filled with "waiting for table'?
Chris Dunaway
2009-10-08 17:07:33
Yes, that it will.
Sean Vieira
2009-10-08 18:59:56
+3
A:
mysql> SELECT '' AS empty_col;
+-----------+
| empty_col |
+-----------+
| |
+-----------+
1 row in set (0.00 sec)
Dan Carley
2009-10-08 16:56:09
+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
2009-10-08 17:05:12