开发者

Selecting a specific Date Time from a datetime field in MySQL

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜