Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL

Re: SQL

From: Hakan Eren <heren_at_home.com>
Date: 2000/06/24
Message-ID: <39542089.4951D7D7@home.com>#1/1

hi,

i think you want something like that:

select acctno, name, count(ssn)
  group by acctno, name
  having count(ssn) > 1

or (you were not clear)

select ssn, count(acctno)
  group by acctno, name
  having count(acctno) > 1

regards

Hakan

Brian Vuong wrote:
>
> Could someone help me with this. I have two fields, acctno ( account
> number) and ssn. I would like to write a query to obtain only the customers
> that have more than one account. To determine if someone has more than one
> account by checking for duplicate ssn. Both ssn and acctno are character
> fields. I spent two days to try to figure out, but I could not do it.
> There is only 1 table
>
> select acctno, name, ssn
> from table1
> where count(ssn)>1; <----------------this does not work.
>
> Sincerely,
>
> Brian
  Received on Sat Jun 24 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US