开发者

mysql between query

开发者 https://www.devze.com 2023-02-16 20:03 出处:网络
I have this scheme: --------------------开发者_运维问答------ ID | data| timestamp | --------------------------

I have this scheme:

--------------------开发者_运维问答------
| ID | data  | timestamp |
--------------------------

how i can make a query to show only today values? I now i need to use the BETWEEN statement, any idea?


SELECT   *
FROM     mytable
WHERE    DATE(timestamp) = CURDATE()

Or so I think.


select ID, date, timestamp
from yourtable
where DATE(`timestamp`) = CURDATE()
0

精彩评论

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