我有一个mysql表
C1 - C2
A - 25.6
B - 22.5
C - 19.5
E - 15.6
A - 18.5
B - 20.5
F - 18.2
D - 19.6
F - 16.1
E - 20.6
我需要订购 DESC c2,而不重复 c1
A - 25.6
B - 22.5
E - 20.6
D - 19.6
F - 18.2
我到目前为止
for ($i=1; $i<=5; $i++) {
$query = mysql_query("SELECT * FROM myTable WHERE date='$SL_DATE' ORDER BY c2 DESC LIMIT $i",$db);
while ($row = mysql_fetch_array($query)) {
$c2_[$i] = $row[c2];
}
}
有任何想法吗?