Select bigger string from 2 or more strings in a column
Posted on 2009-06-27
I want to make a group seletc that retrieves a distinct string from col1 and the larger string from col2.....
[col1] [col2 ] [col3]
1111 aaa 3
2222 bbb 3
1111 ccccc 5
2222 ddddd 5
3333 eeee 4
3333 f 1
col1 and col3 are string , col3 int with the length of the string in col2.....
i made several mysql query and sometimes retrieves the larger string, others not.
i know how to do this with php but i want to doit in a mysql query, maybe i need a sub query...