[英]seletc date query using prepared statement
In the database same date is multiple time there. 在数据库中,同一日期是多个时间。 The table data contain date with time if I use this it is not giving the record that I need to modify. 如果我使用此数据,则表数据中包含带时间的日期,它没有给出我需要修改的记录。 I want 2012-11-21
this date all records. 我要2012-11-21
这个日期所有记录。 But token_gen_time
it contains 2012-11-21 1:00:00
. 但是token_gen_time
它包含2012-11-21 1:00:00
。 How can I write query to select depending on date. 如何编写查询以根据日期进行选择。
SELECT * FROM mias_log
where activity_status='Token Generated'
AND token_gen_time='2012-11-21 '
In order to make use of index (if available in token_gen_time), use this 为了利用索引(如果在token_gen_time中可用),请使用此
SELECT *
FROM mias_log
where activity_status = 'Token Generated'
and token_gen_time >= '2012-11-21'
and token_gen_time < '2012-11-22'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.