How to sort by date when day, month and year are each in a column?

Asked

Viewed 556 times

0

Hello,

I am with the following situation, I have to sort a table by date, but for some particular reason the programmer decided to save the day, month and year in separate columns, Obs the database this in Mysql, there is an effective procedure to do such ordering?

It would be right to use ORDER BY day, month and year ?

Grateful.

  • http://answall.com/a/12021/91

1 answer

2


If the type of the columns is whole just make one ORDER BY ANO, MES, DIA. If it is in textual format, especially if you have mixed values with two or one digit, check the link that the user "lost" put as a comment on your question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.