我正在尝试使用 MySQL CASE 语句从产品表中选择产品。
我有这个:
SELECT art.a,art.b,art.c
FROM products AS art
WHERE art.inventory != "0"
# filter by param_reference_iln (seller ID = vARCHAR(13) )
CASE
WHEN param_reference_iln = '3333333333333' THEN AND art.iln = '1111111111111' OR art.iln = '2222222222222'
WHEN param_reference_iln = '8888888888888' THEN AND art.iln = '7777777777777'
ELSE AND art.iln NOT IN ('1111111111111','2222222222222','7777777777777')
END CASE;
我已经尝试了两种CASE 变体,但我都无法工作。
问题:
我做错了什么?