的我试图合并的表其是fus_shift和根表到一个新的表,该表是最后的表但在第2行输出,如“ERROR: ORA-01789:查询块具有不正确的结果列数“。我也尝试加入表作为我的选择,但它也输出“错误在第3行:ORA-00918:列模糊定义”。是否有另一种方法来组合和连接两个不同列数的表,并分别具有相同的列名称?再次感谢:-)
代码错误:
创建表最终为
SELECT * FROM fus_shift
工会
SELECT * FROM根;
结合并连接两个不同的号码表。列和相同的列名
代码错误:
选择record_num,test_num,t_date,t_time,system_type,类别,评论,VAL
从fus_shiftrpt,根
其中record_num = record_num;
我的表:
fus_shift Table
Record_Num test date time system
-----------------------------------------------------------
1 test15 08-11-12 13:20:01 sys23
2 test17 08-11-03 14:24:00 sys24
3 test13 08-11-13 17:25:04 sys45
4 test15 08-11-14 18:24:00 sys67
5 test16 08-11-15 19:24:06 sys45
root Table
Record_Num category comments validated by
---------------------------------------------------
1 dirt checked admin
2 prog checked admin
3 dirt checked pe
4 wires checked ee
5 prog repair admin
强调文本
有没有必要使用表别名来解决查询; WHERE子句完全可以是'WHERE fus_shift.record_num = root.record_num'。 – 2008-12-06 10:49:46
这也可以工作。如果我们不想使用表别名,除了WHERE子句,我们还必须使用表名解析SELECT子句中的公共字段。 – MOZILLA 2008-12-06 14:54:09