DROP TABLE t_change_lc;
CREATE TABLE t_change_lc (card_code VARCHAR
INSERT INTO t_change_lc
SELECT
UNION
SELECT
SELECT * FROM t_change_lc;
SELECT a
SUM(decode(a
SUM(decode(a
SUM(decode(a
SUM(decode(a
FROM t_change_lc a
GROUP BY a
ORDER BY
DROP TABLE t_change_cl;
CREATE TABLE t_change_cl AS
SELECT a
SUM(decode(a
SUM(decode(a
SUM(decode(a
SUM(decode(a
FROM t_change_lc a
GROUP BY a
ORDER BY
SELECT * FROM t_change_cl;
SELECT t
t
decode(t
FROM (SELECT a
FROM t_change_cl a
(SELECT ROWNUM rn FROM dual CONNECT BY ROWNUM <=
ORDER BY
DROP TABLE t_change_lc_comma;
CREATE TABLE t_change_lc_comma AS SELECT card_code
SELECT * FROM t_change_lc_comma;
SELECT t
FROM (SELECT a
a
row_number() over(PARTITION BY a
FROM t_change_lc_comma a) t
START WITH t
CONNECT BY t
AND t
GROUP BY t
DROP TABLE t_change_cl_comma;
CREATE TABLE t_change_cl_comma AS
SELECT t
FROM (SELECT a
a
row_number() over(PARTITION BY a
FROM t_change_lc_comma a) t
START WITH t
CONNECT BY t
AND t
GROUP BY t
SELECT * FROM t_change_cl_comma;
SELECT t
substr(t
instr(
instr(t
FROM (SELECT a
FROM t_change_cl_comma a
(SELECT ROWNUM rn FROM dual CONNECT BY ROWNUM <=
WHERE instr(
ORDER BY
DROP TABLE t_ia_src;
CREATE TABLE t_ia_src AS SELECT
DROP TABLE t_ia_dest_
CREATE TABLE t_ia_dest_
DROP TABLE t_ia_dest_
CREATE TABLE t_ia_dest_
DROP TABLE t_ia_dest_
CREATE TABLE t_ia_dest_
SELECT * FROM t_ia_src;
SELECT * FROM t_ia_dest_
SELECT * FROM t_ia_dest_
SELECT * FROM t_ia_dest_
INSERT ALL
WHEN (c
INTO t_ia_dest_
WHEN (c
INTO t_ia_dest_
ELSE
INTO t_ia_dest_
SELECT c
DROP TABLE t_mg;
CREATE TABLE t_mg(code VARCHAR
SELECT * FROM t_mg;
MERGE INTO t_mg a
USING (SELECT
ON (de = de)
WHEN MATCHED THEN
UPDATE SET a
WHEN NOT MATCHED THEN
INSERT (code
DROP TABLE t_dup;
CREATE TABLE t_dup AS SELECT
INSERT INTO t_dup SELECT
SELECT * FROM t_dup;
SELECT * FROM t_dup a WHERE a
SELECT de
FROM (SELECT de
a
row_number() over(PARTITION BY de ORDER BY a
FROM t_dup a) b
WHERE b
SELECT a
FROM t_employees a
WHERE a
(SELECT b
SELECT a
FROM t_employees a
WHERE EXISTS (SELECT
FROM t_orders b
WHERE b
AND a
SELECT a
FROM t_employees a
WHERE a
AND EXISTS
(SELECT
SELECT a
FROM t_employees a
WHERE a
AND a
DROP TABLE t_fbi;
CREATE TABLE t_fbi AS
SELECT ROWNUM rn
CONNECT BY ROWNUM <=
CREATE INDEX idx_nonfbi ON t_fbi(dt);
DROP INDEX idx_fbi_
CREATE INDEX idx_fbi_
SELECT * FROM t_fbi WHERE trunc(dt) = to_date(
SELECT * FROM t_fbi WHERE to_char(dt
DROP TABLE t_loop PURGE;
create TABLE t_loop AS SELECT * FROM user_objects WHERE
SELECT * FROM t_loop;
DECLARE
BEGIN
FOR cur IN (SELECT * FROM user_objects) LOOP
INSERT INTO t_loop VALUES cur;
COMMIT;
END LOOP;
END;
DECLARE
v_count NUMBER;
BEGIN
FOR cur IN (SELECT * FROM user_objects) LOOP
INSERT INTO t_loop VALUES cur;
v_count := v_count +
IF v_count >=
COMMIT;
END IF;
END LOOP;
COMMIT;
END;
DECLARE
CURSOR cur IS
SELECT * FROM user_objects;
TYPE rec IS TABLE OF user_objects%ROWTYPE;
recs rec;
BEGIN
OPEN cur;
WHILE (TRUE) LOOP
FETCH cur BULK COLLECT
INTO recs LIMIT
FORALL i IN
INSERT INTO t_loop VALUES recs (i);
COMMIT;
EXIT WHEN cur%NOTFOUND;
END LOOP;
CLOSE cur;
END;
DROP TABLE t_lock PURGE;
CREATE TABLE t_lock AS SELECT
SELECT * FROM t_lock;
DECLARE
v_cnt NUMBER;
BEGIN
SELECT MAX(ID) INTO v_cnt FROM t_lock;
v_cnt := v_cnt +
INSERT INTO t_lock (ID) VALUES (v_cnt);
COMMIT;
END;
DECLARE
v_cnt NUMBER;
BEGIN
SELECT ID INTO v_cnt FROM t_lock WHERE ID=
SELECT MAX(ID) INTO v_cnt FROM t_lock;
v_cnt := v_cnt +
INSERT INTO t_lock (ID) VALUES (v_cnt);
COMMIT;
END;
DROP TABLE t_hard PURGE;
CREATE TABLE t_hard (ID INT);
SELECT * FROM t_hard;
DECLARE
sql_
BEGIN
FOR i IN
sql_
EXECUTE IMMEDIATE sql_
END LOOP;
COMMIT;
sql_
FOR i IN
EXECUTE IMMEDIATE sql_
USING i;
END LOOP;
COMMIT;
END;
SELECT *
FROM (SELECT a
FROM (SELECT * FROM t_employees ORDER BY first_name) a
WHERE ROWNUM <=
WHERE rn >
SELECT a
FROM (SELECT * FROM t_employees ORDER BY first_name) a
WHERE ROWNUM <=
SELECT b
FROM (SELECT a
FROM t_employees a
WHERE ROWNUM < =
ORDER BY first_name) b
WHERE b
SELECT CASE
WHEN a
WHEN a
ELSE
END deptno
a
a
SUM(a
FROM scott
GROUP BY GROUPING SETS((a
SELECT a
a
a
a
rank() over(PARTITION BY a
dense_rank() over(PARTITION BY a
rank() over(ORDER BY sal DESC) r
FROM scott
ORDER BY a
SELECT a
a
a
lag(a
lead(a
FROM scott
ORDER BY a
From:http://tw.wingwit.com/Article/program/Oracle/201311/16728.html