Re: build a query
From: Paolo Fossati <fossati_apoloNOSPAM_at_hotmail.com>
Date: Thu, 18 Aug 2011 13:52:50 +0200
Message-ID: <4e4cfd12$0$16649$5fc30a8_at_news.tiscali.it>
Il 18/08/2011 01:07, Andreas Mosmann ha scritto:
> Paolo Fossati schrieb am 17.08.2011 in
> <4e4c29d5$0$6839$5fc30a8_at_news.tiscali.it>:
>
>> Il 17/08/2011 18:30, Gerard H. Pille ha scritto:
>>> Michel Cadot wrote:
>>>> "Paolo Fossati"<fossati_apoloNOSPAM_at_hotmail.com> a �crit dans le
>>>> message de news: 4e4bd509$0$6840$5fc30a8_at_news.tiscali.it...
>>>> | hi all,
>>>> | | i'm trying (with no success ) to build an oracle query , db is
>>>> oracle
>>>> | 10, os windows 2008 64 bit
>>>> | | in a table called "location" i have :
>>>> | | REF location object_count
>>>> | | 1000 a 22
>>>> | 1000 b 22
>>>> | 1001 a 57
>>>> | 1001 b 55
>>>> | .
>>>> | .
>>>> | .
>>>> | | the same object (see the 1001 example ) is existing in 2 different
>>>> | locations (a and b) but the number on objects are not the same (in
>>>> one
>>>> | place are 57, in the other 55)
>>>> | As this number must be the same in all the locations for the same ref
>>>> | (see the 1000 example), how can i spot with query all the refs
>>>> thar are
>>>> | not the same?
>>>> | | thanks a lot fot your help
>>>> | Paolo
>>>>
>>>> All are different or some are different?
>>>>
>>>> Regards
>>>> Michel
>>>>
>>>>
>>>
>>> select ref from (select distinct ref, object_count from location) group
>>> by ref having count(*) > 1
>> thanks a lot for the answer,
>> in this wan i can find all the ref that are in 2 locations with
>> different object_count?
>> i'll try tomorrow... thanks again
>> Paolo
> You find all ref that are in *at*least* 2 locations with different objects.
> Should be the answer of your question, isn't it?
>
> Andreas
>
yes, it is...
Date: Thu, 18 Aug 2011 13:52:50 +0200
Message-ID: <4e4cfd12$0$16649$5fc30a8_at_news.tiscali.it>
Il 18/08/2011 01:07, Andreas Mosmann ha scritto:
> Paolo Fossati schrieb am 17.08.2011 in
> <4e4c29d5$0$6839$5fc30a8_at_news.tiscali.it>:
>
>> Il 17/08/2011 18:30, Gerard H. Pille ha scritto:
>>> Michel Cadot wrote:
>>>> "Paolo Fossati"<fossati_apoloNOSPAM_at_hotmail.com> a �crit dans le
>>>> message de news: 4e4bd509$0$6840$5fc30a8_at_news.tiscali.it...
>>>> | hi all,
>>>> | | i'm trying (with no success ) to build an oracle query , db is
>>>> oracle
>>>> | 10, os windows 2008 64 bit
>>>> | | in a table called "location" i have :
>>>> | | REF location object_count
>>>> | | 1000 a 22
>>>> | 1000 b 22
>>>> | 1001 a 57
>>>> | 1001 b 55
>>>> | .
>>>> | .
>>>> | .
>>>> | | the same object (see the 1001 example ) is existing in 2 different
>>>> | locations (a and b) but the number on objects are not the same (in
>>>> one
>>>> | place are 57, in the other 55)
>>>> | As this number must be the same in all the locations for the same ref
>>>> | (see the 1000 example), how can i spot with query all the refs
>>>> thar are
>>>> | not the same?
>>>> | | thanks a lot fot your help
>>>> | Paolo
>>>>
>>>> All are different or some are different?
>>>>
>>>> Regards
>>>> Michel
>>>>
>>>>
>>>
>>> select ref from (select distinct ref, object_count from location) group
>>> by ref having count(*) > 1
>> thanks a lot for the answer,
>> in this wan i can find all the ref that are in 2 locations with
>> different object_count?
>> i'll try tomorrow... thanks again
>> Paolo
> You find all ref that are in *at*least* 2 locations with different objects.
> Should be the answer of your question, isn't it?
>
> Andreas
>
yes, it is...
Thanks a lot
Paolo
Received on Thu Aug 18 2011 - 06:52:50 CDT