FROM TABLE, SELECT [message #312998] |
Thu, 10 April 2008 05:41  |
j0zele
Messages: 15 Registered: December 2006
|
Junior Member |
|
|
Hi guys, I have a problem with a select
create table tab_1 (
field_1 number,
field_2 number);
create table tab_2 (
field_1 number,
field_2 number,
field_3 number,
field_4 number);
SELECT t1.field_1, res.field_1, res.field_2
from tab_1 t1, (SELECT t2.field_1, t2.field_2
FROM tab_2 t2
WHERE t2.field_3 = 1
UNION
SELECT t22.field_1, t22.field_2
FROM tab_2 t22
WHERE t.22field_3 = 2
AND t.22field_4 = t1.field_2) res
This query doesnt work with the last condition t1.field_2, why??
Thanks
|
|
|
Re: FROM TABLE, SELECT [message #313005 is a reply to message #312998] |
Thu, 10 April 2008 05:55   |
S.Rajaram
Messages: 1027 Registered: October 2006 Location: United Kingdom
|
Senior Member |
|
|
Oracle can see an object it is included in the select statement or if the object is selected as part of outer select.
Regards
Raj
|
|
|
|
|
|
|
Re: FROM TABLE, SELECT [message #313029 is a reply to message #312998] |
Thu, 10 April 2008 07:35  |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Your table-alias is t22, yet your fieldname is t.22field1
How can we tell you didn't make up more lines or typos is your mock-up code?
|
|
|