SELECT *, CASE
WHEN paydatefinal IS NULL OR paydatefinal = '0000-00-00' THEN paydate
ELSE paydatefinal END AS `paydatefinColumn`
FROM
`ws_crm_comenzi`
WHERE
`sezonId` = '4'
AND `service_id` = '1'
AND `finished` = '1'
AND `paydatefinColumn`='2016-09-26'
ORDER BY `paydatefinColumn` DESC
我怎樣才能使一個並從塔(paydatefinColumn)是在的情況下,但在表中進行此列dose't存在MySQL查詢案件
你不能......你必須重複相關的代碼。 – scaisEdge
你是什麼意思 –