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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Uniqueness

Re: Uniqueness

From: Chirag DBA <chiragdba_at_gmail.com>
Date: Wed, 18 May 2005 12:00:44 +0530
Message-ID: <1a362960050517233067e4ee0d@mail.gmail.com>


If it is a primary key, it will be unique... if not then you have to write an sql for finding duplicate values. If there are duplicate values it is not unique.

select col_name from table1 where rowid not in(Select min(rowid) from table1 group by col1,col2,col3,....);

Hope this will work.

Regards - Chirag=20

On 5/18/05, Kean Jacinta <jacintakean_at_yahoo.com> wrote:
> Hi again,
>=20
> Is there a way to check for uniqueness of a value ?
> Apart from set the column to be unique ?
>=20
> For example :
>=20
> Table : mytbl
> PK ID
> ----
> 1
> 2
> 3
>=20
> Insert into mytbl (id) values (2);
>=20
> Oracle will give error.
>=20
>=20
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> --
> http://www.freelists.org/webpage/oracle-l
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 18 2005 - 02:35:23 CDT

Original text of this message

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