0
我使用下面的查詢:如何解決ORA-00907:在關係表中括號不
SELECT MONITOR_ALERT_INSTANCE_ID AS ID,
description,
status,
(SELECT COUNT(*) as count
FROM monitor_alert_ins_msrmnt
WHERE monitor_alert_instance_id IN (SELECT monitor_alert_instance_id
FROM monitor_alert_instance
WHERE co_mod_asset_id =1234
)
GROUP BY monitor_alert_instance_id
ORDER BY monitor_alert_instance_id
) AS COUNT
FROM monitor_alert_instance
WHERE co_mod_asset_id = 1234
內查詢返回正確的結果。我試圖結合兩個查詢一次,並希望得到如下結果:
> ID DESCRIPTION STATUS COUNT
> 101 aaa A 1
> 102 bbb B 3
但它顯示缺少右括號錯誤。請任何幫助。
爲什麼你需要在內部查詢命令? –