??ЧSQL???????
???????????? ???????[ 2013/6/18 10:28:10 ] ????????
????5????????????????????????
????-->??????м??????????????????????????????????????????????????????????????й????
????-->?????
SELECT name
FROM emp
WHERE empno = 1234;
SELECT name
FROM dept
WHERE deptno = 10;
SELECT name
FROM cat
WHERE cat_type = 'RD';
????-->?????
SELECT e.name?? d.name?? c.name
FROM cat c
?? dpt d
?? emp e
?? dual x
WHERE NVL( 'X'?? x.dummy ) = NVL( 'X'?? e.ROWID(+) )
AND NVL( 'X'?? x.dummy ) = NVL( 'X'?? d.ROWID(+) )
AND NVL( 'X'?? x.dummy ) = NVL( 'X'?? c.ROWID(+) )
AND e.emp_no(+) = 1234
AND d.dept_no(+) = 10
AND c.cat_type(+) = 'RD';
????-->???????SQL??????????????????????????????????????????????????????????????????
????6?? ?????????
????-->??????rowid????????????????????Ч
DELETE FROM emp e
WHERE e.ROWID > (SELECT MIN( x.ROWID )
FROM emp x
WHERE x.empno = e.empno);
????7?????truncate ???? delete
????-->???????£????????????????????ι????????????????????rollback??.????δ?????????????rollback???Oracle??????
????-->???SQL??????????????delete????????????insert?????insert??????????delete????update????????????delete??insert
????-->???truncate???????????DDL???????????κλ?????????????????????λ??.???????????Ч.???????rollback????????á?
????8???????????COMMIT??COMMIT????????????????
????-->???п??????????о????????COMMIT???????????????????????????????COMMIT???????????????
????-->COMMIT???????????
????-->1.?????????????????????
????-->2.????????????????е???
????-->3.???redo log buffer??????commit??redo log buffer?е?entries д??????????????????
????-->4.ORACLE?????????3??????е????????
????9?? ??????????
????-->????????£?count??*????count??1?????.???????????????????????????е???????????????????????????????COUNT??EMPNO??
????-->???????????????????????????????????
????10?? ??Where????滻HAVING???
????-->??????????having??????HAVING ??????????????м???????????????й?????????????????????????
????-->???WHERE?????????????????????????????????????????????
????-->??Ч??
SELECT deptno?? AVG( sal )
FROM emp
GROUP BY deptno
HAVING deptno = 20;
scott@CNMMBO> SELECT deptno?? AVG( sal )
2 FROM emp
3 GROUP BY deptno
4 HAVING deptno= 20;
Statistics
----------------------------------------------------------
0 recursive calls
0 db block gets
7 consistent gets
0 physical reads
0 redo size
583 bytes sent via SQL*Net to client
492 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11