答案 0 :(得分:3)
这应按顺序排列Due,Paid和其他人:
SELECT Date, Invoice, ProductName, Qty, Rate, TotalPrice, PaymentStatus, PaymentType
FROM xxxTable
ORDER BY CASE
WHEN PaymentStatus LIKE "%Due%" then 1
WHEN PaymentStatus LIKE "%Paid%" then 2
ELSE 3
END
答案 1 :(得分:0)
SELECT Date
, Invoice
, ProductName
, Qty
, Rate
, TotalPrice
, PaymentStatus
, PaymentType
FROM xxxTable
ORDER
BY PaymentStatus = 'Due' DESC
, date DESC
答案 2 :(得分:-1)
尝试:
select *
from yourtable
order by
`Payment Status`
,Date desc