有两个表 dutbin 和 testitemdutbin结构:
DID (主键 自增长)
customerlotid
state
hifix
pgm
pgm version
bin
testitem
testitem结构:
did
pgm
pgm_version
testitem_no
testitem_nifo
现在求testitem_info,判别条件:当dutbin的pgm,pgm version和表testitem的pgm,pgm version一一对应相等时,testitem_no的值等于x时,求得testitem_info.现在我的语句是这样的,但是求得结果不对,请问错在哪里?select testitem_info from dutbin,testitem where dutbin.PGM = testitem.PGM and dutbin.\"Pgm version\" = testitem.PGM_VERSION and testitem.testitem_no = '$testitem_num'
DID (主键 自增长)
customerlotid
state
hifix
pgm
pgm version
bin
testitem
testitem结构:
did
pgm
pgm_version
testitem_no
testitem_nifo
现在求testitem_info,判别条件:当dutbin的pgm,pgm version和表testitem的pgm,pgm version一一对应相等时,testitem_no的值等于x时,求得testitem_info.现在我的语句是这样的,但是求得结果不对,请问错在哪里?select testitem_info from dutbin,testitem where dutbin.PGM = testitem.PGM and dutbin.\"Pgm version\" = testitem.PGM_VERSION and testitem.testitem_no = '$testitem_num'
解决方案 »
- 通过数据库链接访问Fuction为什么报错?
- 想问一个sqlldr的问题。文件第一行是字段名。load的时候怎么去掉。
- || 运算符问题
- Ora-01722 :無效數字問題
- 简单sql问题,在线等!谢谢!请各位高手帮忙!
- 这条update语句总是报错,错误信息是:Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14' [Microsoft][ODBC driver for Oracle]
- 怎样获取指定的表那些表所依赖?
- 紧急求助:帮我看看一个SQL存储过程,错在什么地方?
- 怎样备份Oracle数据库
- Oracle怎么查询复选框
- 存储过程中如何调用存储过程
- 请教一个关于pl/sql的问题
select t.testitem_nifo from testitem t,dutbin d
where t.testitem_no='x' and t.pgm=d.pgm and t.pgm_version=d.pgm_version 如果要左连select t.testitem_nifo from testitem t,dutbin d
where t.testitem_no='x' and t.pgm=d.pgm(+) and t.pgm_version=d.pgm_version(+)楼主sql不对是不是两个表关联的字段类型不匹配
if((testitem.pgm==dutbin.pgm)&&(testitem.pgm_version==dutbin."Pgm version"))
{
sql = select testitem_info from testitem where testitem_no = 'x';
result;
}
select t.testitem_nifo from testitem t,dutbin d
where t.testitem_no='x' and t.pgm=d.pgm and t.pgm_version=d.pgm_version