query to return specific date from teradata timestamp(6)

妖精的绣舞 提交于 2019-12-05 07:14:01

You may try like this:-

sel * from table A
where date = date '2013-10-22';

Since in ANSI standard form (must be preceded by the keyword DATE)

Check out this

Something like this:

where YourTimestampField >= {d '2013-10-22'}
and YourTimestampField < {d '2013-10-23'}

And more formally:

select * 
from table A
where cast(timestamp_column as date) = date '2013-10-22';

I'm guessing that you were just showing an example, because I don't think you can have a column named date; it's a reserved word. The keyword "date" above is how you specific an ANSI date constant and is not related to the "date" function.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!