Subject | Again Sub-Query Problem |
---|---|
Author | Uwe Oeder |
Post date | 2003-11-18T10:26:09Z |
Please tell me this is also a very simple problem.
SELECT W3.WpIDSQ , W3.WpVBSQ , WpName , DescrData ,
C.CityName || '(' || C.CityDiallingCode || ')' AS CityDialcode
FROM Whitepage W3 LEFT OUTER JOIN Description D ON (W3.WpIDSQ = D.WpVBSQ)
LEFT OUTER JOIN SmallAddress S ON (W3.WpIDSQ = S.WpVBSQ)
LEFT JOIN City C ON (W3.CityVBSQ = C.CityIDSQ)
WHERE Upper(D.DescrData) LIKE '%PO BOX%'
AND
EXISTS
(
SELECT W2.WpIDSQ , W2.WpVBSQ , WpName , DescrData ,
C.CityName || '(' || C.CityDiallingCode || ')' AS CityDialcode
FROM Whitepage W2 LEFT OUTER JOIN Description D ON (W2.WpIDSQ = D.WpVBSQ)
LEFT OUTER JOIN SmallAddress S ON (W2.WpIDSQ = S.WpVBSQ)
LEFT JOIN City C ON (W2.CityVBSQ = C.CityIDSQ)
WHERE Upper(D.DescrData) LIKE '%TAL%'
AND W2.WpIDSQ = W3.WpIDSQ )
AND
EXISTS
(
SELECT W1.WpIDSQ , W1.WpVBSQ , WpName , DescrData ,
C.CityName || '(' || C.CityDiallingCode || ')' AS CityDialcode
FROM Whitepage W1 LEFT OUTER JOIN Description D ON (W1.WpIDSQ = D.WpVBSQ)
LEFT OUTER JOIN SmallAddress S ON (W1.WpIDSQ = S.WpVBSQ)
LEFT JOIN City C ON (W1.CityVBSQ = C.CityIDSQ)
WHERE Upper(W1.WpName) LIKE '%UWE%'
AND
W1.WpIDSQ = W2.WpIDSQ
) ;
Statement failed, SQLCODE = -206
Dynamic SQL Error
-SQL error code = -206
-Column unknown
-W2.WPIDSQ
-At line 31, column 16.
What I don't understand is that I do define W2.WpIDSQ : "SELECT W2.WpIDSQ ,
W2.WpVBSQ ..."
SELECT W3.WpIDSQ , W3.WpVBSQ , WpName , DescrData ,
C.CityName || '(' || C.CityDiallingCode || ')' AS CityDialcode
FROM Whitepage W3 LEFT OUTER JOIN Description D ON (W3.WpIDSQ = D.WpVBSQ)
LEFT OUTER JOIN SmallAddress S ON (W3.WpIDSQ = S.WpVBSQ)
LEFT JOIN City C ON (W3.CityVBSQ = C.CityIDSQ)
WHERE Upper(D.DescrData) LIKE '%PO BOX%'
AND
EXISTS
(
SELECT W2.WpIDSQ , W2.WpVBSQ , WpName , DescrData ,
C.CityName || '(' || C.CityDiallingCode || ')' AS CityDialcode
FROM Whitepage W2 LEFT OUTER JOIN Description D ON (W2.WpIDSQ = D.WpVBSQ)
LEFT OUTER JOIN SmallAddress S ON (W2.WpIDSQ = S.WpVBSQ)
LEFT JOIN City C ON (W2.CityVBSQ = C.CityIDSQ)
WHERE Upper(D.DescrData) LIKE '%TAL%'
AND W2.WpIDSQ = W3.WpIDSQ )
AND
EXISTS
(
SELECT W1.WpIDSQ , W1.WpVBSQ , WpName , DescrData ,
C.CityName || '(' || C.CityDiallingCode || ')' AS CityDialcode
FROM Whitepage W1 LEFT OUTER JOIN Description D ON (W1.WpIDSQ = D.WpVBSQ)
LEFT OUTER JOIN SmallAddress S ON (W1.WpIDSQ = S.WpVBSQ)
LEFT JOIN City C ON (W1.CityVBSQ = C.CityIDSQ)
WHERE Upper(W1.WpName) LIKE '%UWE%'
AND
W1.WpIDSQ = W2.WpIDSQ
) ;
Statement failed, SQLCODE = -206
Dynamic SQL Error
-SQL error code = -206
-Column unknown
-W2.WPIDSQ
-At line 31, column 16.
What I don't understand is that I do define W2.WpIDSQ : "SELECT W2.WpIDSQ ,
W2.WpVBSQ ..."