I have a table with a lot of columns. Some of these are DATETIME
, which I turn into Unix timestamps with UNIX_TIMESTAMP()
. So I don't have to type out all the other columns I want from the table, is there a way of doing something like:
SELECT UNIX_TIMESTAMP(t.start) AS start,
UNIX_TIMESTAMP(t.end) AS end,
t.theOtherColumns
FROM table t
Where t.theOtherColumns
is the rest of the columns in the table. To explain further; I want to select all the columns from the table, perform operations on some of them, but not type out each column name into the query.
When I do, say,
SELECT UNIX_TIMESTAMP(t.start) AS start,
UNIX_TIMESTAMP(t.end) AS end,
t.theOtherColumns
FROM table t
It selects start
and end
twice. I only want to return the start
and end
columns from UNIX_TIMESTAMP()
, and exclude those columns from the t.*
set.