Re: Need help with SQL

From: dan merryman <dan.l.merryman_at_bangate1.tek.com>
Date: 1996/11/11
Message-ID: <32875495.79_at_bangate1.tek.com>#1/1


If your queery really has blank lines before/after UNION try getting rid of the blank lines.

atyagi_at_mc.xerox.com wrote:
>
> Hi folks,
>
> Thanks to all who helped me last time. I have another question for
> you. I have written a query using UNION operator. I have tested these two
> queries seprately and they work well, but when I use the UNION an error
> appears telling me that UNION is an unknown command.. strange!
>
> here is my query :
>
> SELECT input_date, SUM(totbo) as USCO_TOTBO, SUM (xci_count) as XCI_TOTBO
> FROM
> (SELECT input_date, totbo, 0 as xci_count
> FROM uscobosum
> WHERE input_date >= ADD_MONTHS(sysdate,-24) and (TO_CHAR(input_date,'DAY') like 'M%')
>
> UNION
>
> SELECT input_date,0 as totbo, sum(totbo)
> FROM xci_bo
> WHERE input_date >=ADD_MONTHS(sysdate,-24)
> GROUP BY input_date
> )
> GROUP BY input_date;
>
> I will appreciate any help:
>
> Please post or mail to
>
> atyagi_at_mc.xerox.com
 

-- 
   ******************
   Opinions expressed are my own and do not
   necessarily reflect those of my employer
   ******************
Received on Mon Nov 11 1996 - 00:00:00 CET

Original text of this message