Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Uniqueness
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-lReceived on Wed May 18 2005 - 02:35:23 CDT