SET colsep '|'
SET echo OFF
SET feedback OFF
SET linesize 1000
SET pagesize 0
SET sqlprompt ''
SET trimspool ON
SET headsep OFF
spool monitor.csv
SELECT error_id, '|', error_desc, '|', b.control_by
FROM error a, component_info b
WHERE a.error_id IN (
SELECT error_id FROM component_thresh JOIN component_info USING (component_id))
GROUP BY b.control_by
ORDER BY a.error_desc
/
我需要按不同表中的列分组,然后按 error_desc 排序,然后输出结果。
编辑:啊!我需要两者都订购。