Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 查询以从表中获取特定日期(如果日期列为日期数据类型)的记录_Sql_Db2 - Fatal编程技术网

Sql 查询以从表中获取特定日期(如果日期列为日期数据类型)的记录

Sql 查询以从表中获取特定日期(如果日期列为日期数据类型)的记录,sql,db2,Sql,Db2,查询以从表中获取特定日期(如果日期列为日期数据类型)的记录。 我在DB2中工作。 如果我在2011年6月3日(mm/dd/YYYY)提供数据格式 例: 从日期=“2011年6月3日”不起作用的客户表中选择*。日期列是日期数据类型。也许可以将双引号更改为单引号 Select * from table customer where date = '03/06/2011' 此外,使用ISO格式指定日期值可能更可靠: Select * from table customer where date =

查询以从表中获取特定日期(如果日期列为日期数据类型)的记录。 我在DB2中工作。 如果我在2011年6月3日(mm/dd/YYYY)提供数据格式

例:
从日期=“2011年6月3日”不起作用的客户表中选择*。日期列是日期数据类型。

也许可以将双引号更改为单引号

Select * from table customer where date = '03/06/2011'
此外,使用ISO格式指定日期值可能更可靠:

Select * from table customer where date = '2011-03-06'

也许可以把双引号改为单引号

Select * from table customer where date = '03/06/2011'
此外,使用ISO格式指定日期值可能更可靠:

Select * from table customer where date = '2011-03-06'

我认为您需要将字符串日期转换为实际日期,如下所示:

Select * from table customer where date = DATE('03/06/2011');

我认为您需要将字符串日期转换为实际日期,如下所示:

Select * from table customer where date = DATE('03/06/2011');

请更具描述性,说明您迄今为止所做的尝试,并解释您的困境。请更具描述性,说明您迄今为止所做的尝试,并解释您的困境。