是否可以在第一列内进行排序,例如
从表中选择*,其中......按价格说明和距离排序,距离
price holds values
0, 10, 24, 30 ...
and distance are values out of the lon/lat calculation. and now it displays it like this:
value1(price=30) ... 19,8km
value2(price=24) ... 8,2km
value3(price=10) ... 48km
//and then it starts with the entries in which price is 0 with the correct distance order
value4(price=0) ... 1,20km
value5(price=0) ... 1,28km
value6(price=0) ... 2,74km
and so on...
我想要的是,在价格 > 0 的内容中,它应首先显示它们,但以距离作为订购方法,然后显示价格 = 0 和距离的内容
所以基本上它应该忽略价格值本身,只是价格 > 0 在 0 之前,并按价格内的距离排序。该查询是什么样子的?感谢您的帮助:)
这就是我想要的;
value2(price=24) ... 8,2km
value1(price=30) ... 19,8km
value3(price=10) ... 48km
value4(price=0) ... 1,20km
value5(price=0) ... 1,28km
value6(price=0) ... 2,74km
and so on...
最佳答案
使用排序方式 例子 按 asc 从价格订单中选择 * 或者 按描述从价格顺序中选择 *
由你决定
关于php - mysql 按第一列中的列排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41908555/