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.
Use the asterisk character (*) in place of a column list in a SELECT statement to instruct MySQL to return every column from the specified table.
The SELECT statement is used to select data from a database. The data returned is stored in a result table, called the result-set.
To look for NULL values, you must use the IS NULL test. The following statements show how to find the NULL phone number and the empty phone number: mysql> SELECT * FROM my_table WHERE phone IS NULL; mysql> SELECT * FROM my_table WHERE phone = ''; See Section 3.3.
Select column1, column2, 'waiting for table' as dummy_column, column4
from your_table
mysql> SELECT '' AS empty_col;
+-----------+
| empty_col |
+-----------+
| |
+-----------+
1 row in set (0.00 sec)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With