Question: Is it possible to format a date field in a SELECT \* query? I want to get all of the columns from my table but need a different format from the date.

Something like:

```
SELECT *, FORMATDATE(date,'%m-%d-%y') AS date FROM my_table;

```

or do I have to process it in php after the query?

Answer: 
Use [DATE\_FORMAT](http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format):

```
SELECT *, DATE_FORMAT(date, "%m-%d-%y") AS date FROM my_table;

```
in the above solutions the select first extract all columns, then the date column with a requested format, this means that the date columns is returned twice, once in default format and once in requested format. Actually if you want to change the format of 1, 2 ou 3 date columns from you table and you also want to avoid duplicate data returned, you shall remove "\*" from the request and name each and every column instead, correct?

is there a way to ask mysql to change the format of all the datetime columns and ignore the rest with a single command?