像Oracle这样的MySQL中的Trunc日期字段 [英] Trunc date field in mysql like Oracle

查看:1097
本文介绍了像Oracle这样的MySQL中的Trunc日期字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将无法在'mysql'数据库中使用'trunc(in oracle)'函数.我的"mysql"数据库中有一个名为dlb_cc_purchase的表和一个名为due_date的日期字段.数据显示在日期字段中,例如20-11-2014 00:00:00(2014年11月20日).在oracle中,我们使用查询

I am to not able to use the 'trunc(in oracle)' function in 'mysql' database. I have a table called dlb_cc_purchase and date field called due_date in my 'mysql' database. The data displaying in the date field like 20-11-2014 00:00:00 (20-nov-2014). in oracle we are using query

select * from dlbcc_purchase where trunc(due_date) = '20-nov-2014' 

Oracle DB将获取到期日期为20-11-2014 00:00:00的行.如何在"mysql"中使用此功能?

Oracle DB will fetch the row with due date 20-11-2014 00:00:00. How can I use this function in 'mysql'?

我知道这是一个基本问题,但是我试图使用truncate,str_to_date ...来做很长一段时间,但是却无法获取值.请帮忙.

I know this is a basic question, but i was trying to do this for long time with truncate, str_to_date... but not able to fetch value. Please help.

推荐答案

使用 查看全文

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