seavolvox
08-09-2005, 12:18 PM
Hi,
I'm having some troubles trying to set a mysql query...
Imagine you have a table with three columns and their values:
Column1 / Column2 / Column3
1 / Barcelona / A
2 / Madrid / B
3 / Zaragoza / C
4 / Barcelona / D
5 / Barcelona / E
6 / Madrid / C
7 / Barcelona / A
8 / Barcelona / A
I'd like to get values A (ONLY ONCE, not 3 As), D and E.
I've tried to use SELECT DISTINCT but no luck.
The idea is to get all "DISCTINCT" values from Column3 BUT only where Column2 is "Barcelona".
Thank you in advance for your help!
Oups! I'm using PHP!
I'm having some troubles trying to set a mysql query...
Imagine you have a table with three columns and their values:
Column1 / Column2 / Column3
1 / Barcelona / A
2 / Madrid / B
3 / Zaragoza / C
4 / Barcelona / D
5 / Barcelona / E
6 / Madrid / C
7 / Barcelona / A
8 / Barcelona / A
I'd like to get values A (ONLY ONCE, not 3 As), D and E.
I've tried to use SELECT DISTINCT but no luck.
The idea is to get all "DISCTINCT" values from Column3 BUT only where Column2 is "Barcelona".
Thank you in advance for your help!
Oups! I'm using PHP!