martin
Well-Known Member
Moin
mein Vorhaben erkläre ich am besten anhand eines Beispieles. Hier mal der aktuelle Stand:
Als Ergebnis erhalte ich dann Folgendes:
Was ich gerne hätte wäre/ist:
Was mache ich falsch?
Danke für eure Hilfe
mein Vorhaben erkläre ich am besten anhand eines Beispieles. Hier mal der aktuelle Stand:
Code:
mysql> CREATE TABLE test (
-> id MEDIUMINT NOT NULL AUTO_INCREMENT,
-> id1 MEDIUMINT NOT NULL,
-> id2 MEDIUMINT NOT NULL,
-> other_column CHAR(30) NOT NULL,
-> PRIMARY KEY (id,id1,id2)
-> ) ENGINE=MyISAM;
INSERT INTO test (id1, id2, other_column) VALUES (1, 1,'Foo'),(1, 1,'Bar'),(1, 2,'Baz'),(1, 1,'Bam'),(1, 2,'Zam'),(2, 1,'Zoo');
Als Ergebnis erhalte ich dann Folgendes:
Code:
+----+-----+-----+--------------+
| id | id1 | id2 | other_column |
+----+-----+-----+--------------+
| 1 | 1 | 1 | Foo |
| 2 | 1 | 1 | Bar |
| 4 | 1 | 1 | Bam |
| 3 | 1 | 2 | Baz |
| 5 | 1 | 2 | Zam |
| 6 | 2 | 1 | Zoo |
+----+-----+-----+--------------+
Was ich gerne hätte wäre/ist:
Code:
+----+-----+-----+--------------+
| id | id1 | id2 | other_column |
+----+-----+-----+--------------+
| 1 | 1 | 1 | Foo |
| 2 | 1 | 1 | Bar |
| 3 | 1 | 1 | Bam |
| 1 | 1 | 2 | Baz |
| 2 | 1 | 2 | Zam |
| 1 | 2 | 1 | Zoo |
+----+-----+-----+--------------+
Was mache ich falsch?
Danke für eure Hilfe