Forum » Pomoč in nasveti » help - duplicate values and primary key
help - duplicate values and primary key
Thorvald ::
pozdrav
združiti hočem dve tabeli (ne join ampak import) pa pride do problema ker PK ni bil narejen pred vnosom podatkov.
A ima kdo idejo kako v tabeli s približno 10 na 6 rekordov najdem podvojenega.
združiti hočem dve tabeli (ne join ampak import) pa pride do problema ker PK ni bil narejen pred vnosom podatkov.
A ima kdo idejo kako v tabeli s približno 10 na 6 rekordov najdem podvojenega.
Thorvald ::
če koga zanima:
select distinct *
FROM Tabela
WHERE (Index1 IN (SELECT [Index1]
FROM [Tabela] AS Tmp
GROUP BY [Index1], [Index2], [Index3], [Index4], [Index5]
HAVING COUNT(*) > 1 AND [Index2] =[Tabela].Index2]
AND [Index3] = [Tabela].[Index3]
AND [Index4] = [Tabela].[Index4] AND [Index5] = [Tabela].[Index5]))
ORDER BY Index1, Index2, Index3, Index4, Index5
select distinct *
FROM Tabela
WHERE (Index1 IN (SELECT [Index1]
FROM [Tabela] AS Tmp
GROUP BY [Index1], [Index2], [Index3], [Index4], [Index5]
HAVING COUNT(*) > 1 AND [Index2] =[Tabela].Index2]
AND [Index3] = [Tabela].[Index3]
AND [Index4] = [Tabela].[Index4] AND [Index5] = [Tabela].[Index5]))
ORDER BY Index1, Index2, Index3, Index4, Index5
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | Game of Thrones: A Telltale Games SeriesOddelek: Igre | 10173 (7315) | oo7 |
» | iz dhcp v fiksni ipOddelek: Omrežja in internet | 1894 (1602) | Good Guy |
» | Kako najenostavneje pridobiti IP iz windowsa 7?Oddelek: Operacijski sistemi | 2493 (2217) | Pesimist |
» | SQL indeks?Oddelek: Programiranje | 1005 (1005) | ta_pravi |
» | firefox, thunderbird in zvok v kubuntuOddelek: Operacijski sistemi | 1320 (1079) | comp007 |