开发者

Selecting a specific Date Time from a datetime field in MySQL

开发者 https://www.devze.com 2022-12-16 22:16 出处:网络
How can this be done properly in MySQL? I want to select records that are created after a specific date AND time... I thought something simple like this would do 开发者_StackOverflow中文版the trick, b

How can this be done properly in MySQL? I want to select records that are created after a specific date AND time... I thought something simple like this would do 开发者_StackOverflow中文版the trick, but I think it needs a bit more to it to work.

SELECT `modified` FROM `Blog` WHERE `modified` > 2010-01-08 16:01:01

Any help appreciated.


I think you are missing some quotes:

SELECT `modified` FROM `Blog` WHERE `modified` > '2010-01-08 16:01:01'

You might also want to select some other fields apart from just the modified field. You could start with this until you know which fields you want:

SELECT * FROM `Blog` WHERE `modified` > '2010-01-08 16:01:01'
0

精彩评论

暂无评论...
验证码 换一张
取 消