-1
scheduled_datetime
2016-12-07 10:30:00
2016-12-07 13:30:00
2016-11-06 22:30:00
2016-12-06 23:30:00
2016-19-08 22:30:00
に日付をソートします違う 。あなたがデータを取得したいどのような順序でASCまたはDESCよると、BY ORDERを使用することができますはどのように賢明な最初の日付をソートmysqlの
--If you want to fetch records greater than current date & time
select * from mytable where scheduled_datetime > NOW()
--If you want to fetch records greater than current date
select * from mytable where scheduled_datetime > CURDATE()
--If you want to fetch records greater than current time
select * from mytable where scheduled_datetime > CURTIME()
:
質問があるか、ソートやフィルタリング。実際には両方とも現在のクエリで起きています。 –
_ascending_または_descending_をソートしますか? – rbr94
注文ベースの1つの機能と過去の日付と時刻の両方に同意と降順 –