We can sort date and time together by using the ADDTIME function.
select * from mytable ORDER BY ADDTIME(mydate, mytime);
You can also use the ADDTIME in the select clause to get data and time together.
select ADDTIME(mydate, mytime), city from mytable
No comments:
Post a Comment