MySQL(5.7.x):無論如何要在WHERE條件下做三元論證嗎?三態在WHERE條件(MySQL)?
我想基於選擇的值運行和條款:
SELECT DISTINCT p.user_id, eml.template, eml.subject
FROM order_lines ol, email_template eml
JOIN user p ON ol.user_id = p.user_od
WHERE ol.status in (9.2, 10)
-- This line here
AND eml.name = (ol.status = 10 'SurveyOne' ? 'SurveyTwo')
我需要得到USER_ID,並根據ol.status值從EML條件行。
真棒。正是我在找什麼。謝謝! – guice