select distinct
assignedTo,
alert_id,
insert_date_time,
alert_status_id,
alert_action_id,
alert_call_reason_id,
target_date
from Case_Management.AlertDetail
工作正常。
select distinct
assignedTo,
alert_id,
max(insert_date_time),
alert_status_id,
alert_action_id,
alert_call_reason_id,
target_date
from Case_Management.AlertDetail
返回错误 列 'Case_Management.AlertDetail.assignedTo' 在选择列表中无效,因为它不包含在聚合函数或 GROUP BY 子句中。
我难住了。