Subject | Sub-Query Problem |
---|---|
Author | Uwe Oeder |
Post date | 2003-11-18T08:55:36Z |
I try to run the following query but it always throws me an error
SELECT 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 '%PO BOX%'
AND
EXITS
(
SELECT 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 = -104
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 12, char 1
-SELECT
SELECT 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 '%PO BOX%'
AND
EXITS
(
SELECT 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 = -104
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 12, char 1
-SELECT