我想用这样的东西设置多个字段,我怎样才能让它工作?
Select TableId,
CASE
WHEN StartTime > Appt THEN
Field AS Field_1
FieldId AS FieldId_1
WHEN StartTime BETWEEN Appt AND DATE_ADD(Appt, INTERVAL 1 MONTH) THEN
Field AS Field_2
FieldId AS FieldId_2
END
FROM TableA;
它不起作用,AS Field_1 附近的语法错误。