我正在尝试执行一个允许视图中包含多个列的查询。任何帮助都会有所帮助。
SELECT queuecall1.StartTime, queuecall1.QueueName
CASE
WHEN ExitReason = 7 THEN 1 ELSE 0 END AS CallsAbandoned
WHEN ExitReason = 1 THEN 1 ELSE 0 END AS CallsAgent
WHEN calltype = 1 THEN 1 ELSE 0 END) AS CallsInternal
WHEN calltype = 2 THEN 1 ELSE 0 END) AS CallsExternal
FROM (queuecall queuecall1 INNER JOIN connect connect1
ON queuecall1.ConnectTableID=connect1.ID) INNER JOIN call call1
ON connect1.CallTableID=call1.ID