April 2, 2004 at 8:13 am
Hi,
I am sure I must be doing something stupid but I am having a problem using a UNION within a SELECT statement, I am getting the following error 'Incorrect syntax near the keyword 'WHERE' and I cannot see what I am doing wrong (see statement below).
SELECT findings, packingdets from
(SELECT findings, packingdets, SV_CASEREF FROM RECEIVEGOODS
UNION
SELECT findings, packingdets, SV_CASEREF FROM RECEIVEGOODS_V1) WHERE SV_CASEREF = 'P4476#70211'
The similar statement appears to work OK against Oracle !!
Anyone have any ideas?
Any help welcomed... thanks
Chris
April 2, 2004 at 8:15 am
SELECT findings, packingdets from
(SELECT findings, packingdets, SV_CASEREF FROM RECEIVEGOODS
UNION
SELECT findings, packingdets, SV_CASEREF FROM RECEIVEGOODS_V1) a WHERE SV_CASEREF = 'P4476#70211'
April 2, 2004 at 9:27 am
Excellent, thank you for your assistance.
Am I right in thinking that the 'a' is aliasing the primary SELECT?
April 2, 2004 at 5:41 pm
table alias
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply