Get one result that starts with the same lchar
Posted: Sat Nov 06, 2004 11:59 am
Hi,
I am using MySQL with php.
I have one table containing an ID and a breed column. I would like to get the result from breed column, but, if the result starts with the same letter then only one will be printed in ascending order.
For example if I have this in my table:
Bernese Mountain Dog
Bobtail
Bull Terrier
English Bulldog
Havanese
Mudi
This would be printed only:
Bernese Mountain Dog
English Bulldog
Havanese
Mudi
I couldn’t figure out how to achieve this. I tried to search for this on the web, but this problem can't be explained in two-three words.
I am using MySQL with php.
I have one table containing an ID and a breed column. I would like to get the result from breed column, but, if the result starts with the same letter then only one will be printed in ascending order.
For example if I have this in my table:
Bernese Mountain Dog
Bobtail
Bull Terrier
English Bulldog
Havanese
Mudi
This would be printed only:
Bernese Mountain Dog
English Bulldog
Havanese
Mudi
I couldn’t figure out how to achieve this. I tried to search for this on the web, but this problem can't be explained in two-three words.