Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sql query to get non-unique values

Muhammad.RizwanJun 19 2014 — edited Jun 20 2014

Hi,

I am using oracle 11g.

I've a table (T1) with below data and want to insert these value into another table (T2).

CITY            STATE
--------------- --
San Francisco   CA
Palo Alto       CA
Sarasota        FL
New York        NY
Boston          NY
Boston          CO


Table 2 has a unique constraint on city and state columns.


I want to filter non-unique records before inserting data into table 2 to avoid UNIQUE Constraint exception.


so, in the above example, the query should display below records


Boston          NY
Boston          CO


any ideas?


thanks

This post has been answered by Frank Kulash on Jun 20 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 18 2014
Added on Jun 19 2014
13 comments
4,120 views