I have field name "codehead" whose values are like
"53/066/10"
"54/066/05"
"56/066/09"
"52/069/15"
"53/069/02"
"67/069/02"
"00/020/80"
"00/020/98"
I want the results to be in following order
"00/020/80"
"00/020/98"
"53/066/05"
"53/066/10"
"54/066/09"
"52/069/15"
"53/069/02"
"67/069/02"
I have tried query like
$data= mysql_query("select codehead,sign, SUM(amt) as amt from pm where month='$pmmonth' and rc='R' GROUP BY substr(codehead,4,3) ASC,substr(codehead,7,2) ASC, sign ")
but could not get complete result.