Forum: SQL |
Thema:
Re: Duplikate entfernen ... |
Von:
Thomas Golla (
06.12.2004 09:23) |
Hi :-)
Mal sehen ob ich dein Problem richtig verstanden habe:
Du hast eine Tabelle ähnlich dieser (bloß mit mehr Spalten und Reihen :-)
id werta wertb wertc wertd
1&npsp;&npsp;A A B B
2&npsp;&npsp;A A B C
3&npsp;&npsp;A B B D
4&npsp;&npsp;A C C D
5&npsp;&npsp;A E E E
6&npsp;&npsp;F F F F
7&npsp;&npsp;G F G G
8&npsp;&npsp;G G G G
9&npsp;&npsp;Z Z Z Z
...
Um alle Zeilen herauszubekommen die in einer Spalte einen doppelten Wert haben würde ich folgende SQL Anweisung ausprobieren:
select id, werta, wertb, wertc, wertd
from testo
where werta in (select tab1.werta from (select werta, count(werta) as 'cwerta' from testo group by werta having count(werta) > 1) as "tab1")
or wertb in (select tab2.wertb from (select wertb, count(wertb) as 'cwertb' from testo group by wertb having count(wertb) > 1) as "tab2")
... (hier geht es dann weiter für die anderen Spalten ...)
Hoffe es hilft bzw. ist ein Gedankenanstoss
Lieben Gruß
Tom
Betreff |
Von |
Datum |
|
  |
Re: Duplikate entfernen ...
<br><br>Hi :-)<br>Mal sehen ob ich dein Problem richtig verstanden habe:<br><br>Du hast eine Tabelle ähnlich dieser (bloß mit mehr Spalten und Reihen :-)<br><br>id werta wertb wertc... |
 |
 |
 |
|
|
Thomas
Golla
|
06.12.2004 09:25 |
|
|
Antworten
Vorsicht bei der Eingabe: Die Zeichen ' oder -- sind nicht erlaubt!