Hi
Wenn ich nen query mach z.b.
mysql_query("SELECT DISTINCT `title` FROM `tabelle`");
Bekomm ich alle verschiedenen titel 1 mal auch wenn einer doppelt vorkommt.
Angenommen in der tabelle sind folgende Datensätze:
titel | bla
----------------------------
A | 1
A | 2
C | 3
D | 4
D | 5
Ich will das ich
title A und bla 1,
title C und bla 3,
und title D und bla 4 bekomm.
aber bei nem Distinct query bekomm ich alle Datensätze weil die bla's
unterschiedlich sind.
geht es das ich irgendwie sage :
mysql_query("SELECT DISTINCT `title`,`bla` FROM `tabelle`");
und das das Distinct nur für das feld title gilt und ich einfach das zugehörige bla dzubekomme??
Mfg Bouni
Wenn ich nen query mach z.b.
mysql_query("SELECT DISTINCT `title` FROM `tabelle`");
Bekomm ich alle verschiedenen titel 1 mal auch wenn einer doppelt vorkommt.
Angenommen in der tabelle sind folgende Datensätze:
titel | bla
----------------------------
A | 1
A | 2
C | 3
D | 4
D | 5
Ich will das ich
title A und bla 1,
title C und bla 3,
und title D und bla 4 bekomm.
aber bei nem Distinct query bekomm ich alle Datensätze weil die bla's
unterschiedlich sind.
geht es das ich irgendwie sage :
mysql_query("SELECT DISTINCT `title`,`bla` FROM `tabelle`");
und das das Distinct nur für das feld title gilt und ich einfach das zugehörige bla dzubekomme??
Mfg Bouni
Kommentar