Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help with a complicate sql select request
Thorsten Knopel wrote:
> Sorry corrected value in Table B > > Thorsten Knopel wrote: >
Note that 'user' is a poor choice for a column name since it is also a built-in variable returning the user's login name. So it must be qualified in queries with the tablename:
select mega_grp, b.user, count(*)
from tablea a
join tableb b
on a.mega_grp = 'mg1' and a.grp = b.grp
group by mega_grp, user
having count(*) > 1;
Just leave off the "a.mega_grp = 'mg1'" filter to find all users in any mega-grp. This will work for mega-grps defined with 2 or more grps/
Art S. Kagel
>> I tried it with a subselect and an IN Operation but then i get all
>> user which are in one of the groups but not in both.
>>
>>
>> Thanxs for your help
>>
>> Thorsten
Received on Fri Jul 07 2006 - 09:34:31 CDT
![]() |
![]() |