Re: Help writing an SQL Script
Date: 6 Jul 2004 14:14:12 -0700
Message-ID: <4b5394b2.0407061314.539b6d7c_at_posting.google.com>
alan.terry74_at_btinternet.com (Chuck100) wrote in message news:<eecdee57.0407050707.1458aae2_at_posting.google.com>...
> I'm having problems with the output of the following script (I've
> simplified it):-
>
> select a.section,a.user,count(b.number),null
> from table a, table b
> where.........
> group by a.section,a.user
> union
> select a.section,a.user,null,count(c.number)
> from table a, table c
> where .......
> group by a.section, a.user
>
> The output looks like this:-
>
> Section User col A col b
> ------- ---- ----- -----
>
> section 1 user A 22 0
> 0 12
>
> section 2 user d 10 0
> 0 9
>
> I want the output to look like this:-
>
> Section User col A col b
> ------- ---- ----- -----
>
> section 1 user A 22 12
>
> section 2 user d 10 9
>
> i.e I don't want a second line reflecting the statement after the
> union command. I want the entry to appear on the one line. I''m using
> Report Oracle Reports Builder to do the script
>
> Thanks
Then you want a join query instead of a union. Received on Tue Jul 06 2004 - 23:14:12 CEST