formatage SQL

This commit is contained in:
Yacine31
2024-02-10 02:30:28 +01:00
parent 2d51059e6c
commit a4bc29b998
35 changed files with 538 additions and 401 deletions

View File

@@ -1,30 +1,41 @@
prompt <h2>Sessions Aggregate per Module and Action</h2>
WITH x AS (
SELECT COUNT(*),
--con_id,
module,
action,
inst_id,
type,
server,
status,
state
FROM gv$session
GROUP BY
--con_id,
module,
action,
inst_id,
type,
server,
status,
state
WITH X AS (
SELECT
COUNT(*),
--con_id,
MODULE,
ACTION,
INST_ID,
TYPE,
SERVER,
STATUS,
STATE
FROM
GV$SESSION
GROUP BY
--con_id,
MODULE,
ACTION,
INST_ID,
TYPE,
SERVER,
STATUS,
STATE
)
SELECT x.*
--,c.name con_name
FROM x
--LEFT OUTER JOIN v$containers c ON c.con_id = x.con_id
ORDER BY
1 DESC,
--x.con_id,
x.module, x.action, x.inst_id, x.type, x.server, x.status, x.state;
SELECT
X.*
--,c.name con_name
FROM
X
--LEFT OUTER JOIN v$containers c ON c.con_id = x.con_id
ORDER BY
1 DESC,
--x.con_id,
X.MODULE,
X.ACTION,
X.INST_ID,
X.TYPE,
X.SERVER,
X.STATUS,
X.STATE;