我的表格中有两种类型的交易1)One way relocation deal and 2)Regular deal
。我的 db -Vehicles 中有一张桌子。
vehicles table
=====================================================
id, pickuplocation, returnlocation, included location
现在,当用户One way relocation deal
在 db 中选择 then 时,只会id,pickuplocation,returnlocation
插入并且该列included location
将为空。当用户选择时Regular deal
,该列将为pickuplocation,returnlocation
空,只有列id and included location
将设置。问题是我想使用他们的位置对整个数据进行排序。我试过这个查询 -
SELECT *
FROM vehicles
where 1=1
ORDER BY pickuplocation ASC,returnlocation ASC
但它不会给出正确的结果,因为某些数据在包含的位置为空。我如何对所有数据进行排序pickuplocation,returnlocation,exculded location