Query with union clause
Posted: Sat 16 Aug 2014 15:08
Good morning,
I have a query that looks like this:
"SELECT * FROM zips.zips
WHERE County = 'fairfield' AND State = 'ct'
UNION
SELECT * FROM zips.zips
WHERE County = 'TIOGA' AND State = 'ny'
When I paste it into a new sql window, it executes fine. However when I save it & try to rerun it, it throws and error with no message.
Can someone explain in some detail how a group by workaround might be accomplished? Thanks in advance.
I have a query that looks like this:
"SELECT * FROM zips.zips
WHERE County = 'fairfield' AND State = 'ct'
UNION
SELECT * FROM zips.zips
WHERE County = 'TIOGA' AND State = 'ny'
When I paste it into a new sql window, it executes fine. However when I save it & try to rerun it, it throws and error with no message.
Can someone explain in some detail how a group by workaround might be accomplished? Thanks in advance.