Sql将时间戳与正常日期进行比较 [英] Sql compare TimeStamp with normal date

查看:670
本文介绍了Sql将时间戳与正常日期进行比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将时间戳日期与正常日期进行比较SQL:

How can i compare timeStamp date with normal date SQL:

select * from mg_customers_conversation where timecreated>='2014-09-09'

这将给我 0 值作为它与时间戳的比较

This will give me 0 values as its comparing with timeStamp

注意:创建的列 timecreated 是一个 timestamp

Note :column timecreated is an timestamp

列时间创建 2012-12-01 00:00:00

column timecreated 2012-12-01 00:00:00

谁能解释我如何使用 SQL 中的 Date_format,STR_TO_DATE 方法来做到这一点

And can any one Explain me how can i do this using Date_format,STR_TO_DATE methods in SQL

推荐答案

这行得通

select * from mg_customers_conversation where DATE_FORMAT(timecreated,'%Y-%m-%d')>='2014-09-09'

这篇关于Sql将时间戳与正常日期进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆