1

I got a very simple MySQL query:

'SELECT * FROM `mytable`' 

One of the columns in mytable is a date column. When I use the query above, I get the date as a date and time togather. Is there a way to receive all records like I'm doing with the above query, using *, but change only the date format to have the date only without the time?

1
  • No, you have to list the columns individually. Commented Apr 19, 2015 at 13:38

1 Answer 1

1

You can't change it, but you could add a new one to the result.

select *, DATE_FORMAT(`date_column`, '%Y-%m-%d') AS foo from `mytable` 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.