tapan — 2013-02-20T07:40:36-05:00 — #1
I have a database in which i have required data. I am setting up linnworks and in that i have to do sql queries to get data from the database. The required data is in the database but column names are different than required by linnworks. How do I change column names in the SELECT sql statement so that when data is returned it returns the col names as required by linnworks and not what's there in database.
john_betong — 2013-02-20T08:41:21-05:00 — #2
You're in luck I have recently struggled trying to find a solution using Google and finally arrived at the SQL statement:
master_table_from_csv CHANGE COLUMN
I discovered that with mysql it is essential to include the field type AND VARCHAR must be all in capitals.
tapan — 2013-02-20T12:25:05-05:00 — #3
Thanks for the solution but I do not want to permanently change the column names. Just when I doing the query they should return the data with the corrosponding temp. col name but permanently they should stay like they are. How to achieve that ?
r937 — 2013-02-20T12:40:47-05:00 — #4
answer: use column aliases
SELECT nicename1 AS crapname1
, nicename2 AS crapname2
tapan — 2013-02-21T05:53:44-05:00 — #5
Exactly what i wanted.