我在widget_event_data
表中有played_dt
列。这种格式2009-06-16 21点38分07秒SQL查询 - 无法比较字段值?
我想行其played_dt
plyed_dt
保存日期包含2009-06-16
有什么办法去做这个。我怎么能写这个SQL查询?
将是帮助感激..
我在widget_event_data
表中有played_dt
列。这种格式2009-06-16 21点38分07秒SQL查询 - 无法比较字段值?
我想行其played_dt
plyed_dt
保存日期包含2009-06-16
有什么办法去做这个。我怎么能写这个SQL查询?
将是帮助感激..
WHERE DATE(played_dt) = '2009-06-16'
select * from your_table
where played_dt like '2009-06-16%'
select * from table where played_dt = '2009-06-16'
将
作品在oracle中。
使用DATE()
函数。试试这个:
select *
FROM widget_event_data
where DATE(played_dt) = DATE('2009-06-16')
select * from tableName
where played_dt = str_to_date('2009-06-16', '%Y-%m-%d')
有什么用?% 你能告诉我吗? – Vicky
%是字符串通配符匹配器 –
'%'是通配符,意味着日期字符串只能匹配日期而不匹配其他日期。 –