【发布时间】:2012-06-21 07:17:12
【问题描述】:
这次我遇到了另一个问题,它是关于 DB2 查询的,在 NWDS 中运行。我使用的数据库规范是:
Database:- EP1,
Schema:- W2HCMSC,
Tablespace:- W2HCMTS,
Table:- TESTEMPLOYEE,
Cloumns:- ZONE, Workshop, Year, Employee Name, Designation, DOB.
带有值的数据库快照是我要运行的选择语句,它是带有 where 子句的选择查询,但它不返回任何行。 这些是详细信息:
select * from w2hcmsc.testemployee
(返回 4 行)
select * from w2hcmsc.testemployee where 'w2hcmsc.Zone' = '1'
(0 行返回)
select * from w2hcmsc.testemployee where 'Zone' = 1
(SQL0420N 在 函数“DECFLOAT”。 SQLSTATE=22018)
select * from w2hcmsc.testemployee where zone = 1
SQL0206N “ZONE”在使用它的上下文中无效。 SQLSTATE=42703
select * from w2hcmsc.testemployee where Zone = 1
SQL0206N “ZONE”在使用它的上下文中无效。 SQLSTATE=42703
select * from w2hcmsc.testemployee where 'Zone' = '1'
(已选择 0 条记录)。
请告诉我为什么带有 where 子句的选择查询不起作用。我必须以任何不同的方式编写它吗?
【问题讨论】: