|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Eliminate duplicate rows
I need a little help with the following problem:
I would like to have a result set containing all entries of one table that are not distinct. Then delete them if they are found in another table e.g.: SELECT DISTINCT value FROM table A value ------- 101 250 300 DELETE FROM table B WHERE value != 101 AND value != 250 AND value != 300 Is there a way to do what I've done above quicker than these? Any ideas? Thanks! |
|
#2
|
||||
|
||||
|
not totally sure i understood your situation but it sounds like this:
delete from tableB where value not in ( select distinct value from tableA ) rudy http://r937.com/ |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Eliminate duplicate rows |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|