Autor Beitrag
neodeus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 51

WinXp
D7 Ent. (Unternehmens Lizenzs von Vaters Comp. )
BeitragVerfasst: So 27.06.04 14:23 
Hallo erstmal, ich habe folgenes Problem:
Ich habe eine mySQL Tabelle in der 2 Spalten sind, in der die Werte beliebig oft vorkommen dürfen !
Es darf nur nicht 2 mal die selbe Zeile geben, in der die Werte der beiden Spalten gleich sind !!

Da der text bestimmt jeden verwirrt, hier mal ein beispiel :

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
Position -- Spalte XY -- Spalte YX -- Rechnungsnummer
-----------------------------------------------------
2        --  assaasas -- asasassa  --   5               -> Ok
2        -- asasasasa -- saasasasa --   4               -> Ok
3        -- saasasas  -- sasaasasa --   4               -> Ok
3        -- saasasass -- saasasass --   4               -> Nicht ok, es gibt schon einen datensatz der so aussieht !!!


Kla man könnte es Software seitig lösen, aber ich möchte es am liebsten durch Attribute Serverseitig machen ! geht das überhaupt ?
CenBells
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1547

Win 7
Delphi XE5 Pro
BeitragVerfasst: So 27.06.04 14:43 
Hallo,

erstelle einen unique index über beide Spalten.. Wobei ich gerade nicht weiß, ob MySQL das unterstützt.. :lol:

Gruß
Ken

_________________
Eine Klasse beschreibt die Struktur und das Verhalten einer Menge gleichartiger Objekte.
neodeus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 51

WinXp
D7 Ent. (Unternehmens Lizenzs von Vaters Comp. )
BeitragVerfasst: So 27.06.04 15:37 
geht danke !