in mysql, is it possible to get all columns and data from a table, but select the ID column as NULL?
Something like
SELECT *, id AS (SELECT '') FROM my_table WHERE 1
I want to pull in the ID column, so it doesn’t mess up the column count for a later data load, but I want to eliminate the column’s value so it doesn’t cause key conflicts.
Thanks!
So, there is no way to use
SELECT *and replace one of the columns with another value.If you don’t want to use the select statement provided in your application code, you can create a view with those fields populated and the ID nulled out. You’ll still have to name all the columns at least once.
Here is the easy way to get all of your column names: