我正在尝试在oracle上执行以下sql语句:
SELECT
a.*, b.*
FROM
v$sql a,
v$sql_bind_capture b
WHERE
b.sql_id = a.sql_id
AND
b.sql_id IN
( select sql_id from v$sql where rownm < 100 order by elapsed_time desc)
ORDER BY
b.child_address, b.position
错误代码是“缺少右括号。
我想从elapsed_time命令从v $ sql获取100个顶级语句,然后从视图v $ sql_bind_capture获取相应的绑定。
有人可以提前帮助我
答案 0 :(得分:0)
SELECT *
FROM ( SELECT * FROM ( SELECT * FROM V$SQL ORDER BY ELAPSED_TIME DESC ) WHERE ROWNUM <= 100 ) a
INNER JOIN
v$sql_bind_capture b
ON ( b.sql_id = a.sql_id )
ORDER BY
b.child_address,
b.position;