дORACLE SQL
Ò».°´Ó¢ÎÄ×ÖĸÅÅÐò:
select * from table order by nlssort(name,'NLS_SORT=schinese_pinyin_M');
¶þ. дһ¸öSQLÓï¾ä£¬²éѯѡÐÞÁË5Ãſγ̵ÄѧÉúѧºÅºÍÐÕÃû£¨9·ÖÖÓ£©
´ð£ºSQLÓï¾äÈçÏ£º
select stu.sno, stu.sname
from student stu
where (select count(*) from sc where sno=stu.sno) = 5;
Èý. ÔÚSQLÖÐɾ³ýÖظ´¼Ç¼µÄ·½·¨:£¨Óõ½rowid (oracleαÁÐ)£©
1£©Í¨¹ý½¨Á¢ÁÙʱ±íÀ´ÊµÏÖ
SQL>create table temp_emp as (select distinct * from employee)
SQL>truncate table employee; (Çå¿Õemployee±íµÄÊý¾Ý£©
SQL>rename temp_emp to employee; (ÔÙ½«±íÖØÃüÃû£©
2£©Í¨¹ýʹÓÃrowidÀ´ÊµÏÖ¡£
SQL>delete from employee where rowid not in (
select max(t1.rowid) from employee t1 group by
t1.emp_id,t1.emp_name,t1.salary);--ÕâÀïÓÃmin(rowid)Ò²¿ÉÒÔ¡£
ËÄ. TOP NÎÊÌ⣺£¨Óõ½rownum (oracleαÁÐ)£©
--rownumÖ»ÄÜʹÓÃ<=»ò<µÄ¹Øϵ±È½ÏÔËËã·û
select * from s_emp where rownum <= 2;
--²éѯ¹«Ë¾¹¤×Ê×î¸ßµÄ3¸öÈË
/*select * from emp
where rownum <= 3
order by sal desc;*/ ´íÎóµÄ
select * from (select * from emp order by sal desc)
where rownum <= 3;
Îå.·ÖÒ³²éѯ£º
--²éѯµÚ1-5Ìõ¼Ç¼
select * from (select rownum num, s_emp.* from s_emp)
where num >=1 and num <= 5;
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
1) »ù±¾½á¹¹
BEGIN
... --Óï¾ä
EXCEPTION -- ÀýÍâ´¦Àí
WHEN ...
...
WHEN OTHERS
...
END;
2) ³£ÓÃÔ¤¶¨ÒåÀýÍâ
EXCEPTION
WHEN CU ......
ʹÓÃEXP
EXPÃüÁîÐÐÑ¡Ïî
1,BUFFER
¸ÃÑ¡ÏîÓÃÓÚÖ¸¶¨ÌáÈ¡ÐÐÊý¾ÝʱµÄ»º³åÇø³ß´ç.ͨ¹ýÉèÖøÃÑ¡Ïî,¿ÉÒÔÈ·¶¨µ¼³öʱÊý¾ÝÌáÆð³ß´ç.¸ÃÑ¡ÏîÖ»ÊÊÓÃÓÚ³£¹æÑ¡Ïî.
Exp scott/tiger tables=dept,emp file=a.dmp buffer=81920
2,COMPRESS
¸ÃÑ¡ÏîÓÃÓÚÖ¸¶¨µ¼Èë¹ÜÀí³õʼÇø(INITIAL)µÄ·½·¨.ĬÈÏֵΪY.µ±ÉèÖøÃÑ¡ÏîΪYʱ,oracle»á½ ......
ÔÚ½øÐÐÊý¾Ý¿â¹ÜÀíµÄʱºò£¬ºöȻһϼDz»ÆðÃüÁîºÍÓï·¨£¬ÌرðÊǸø¿Í»§×öÑÝʾ£¬»òÕßÊÇÏÖ³¡ÊµÊ©£¬ÓÐûÓа취²éÊֲᣬûÓа취£¬ÊµÔÚÊÇÞÏÞΣ¬ÎÒÃÇʹÓÃlinuxµÄʱºò£¬Ò²ÊÇͨ¹ý´óÁ¿µÄÃüÁîÐÐÃüÁîÀ´½øÐÐϵͳµÄά»¤£¬Èç´Ë¶àµÄÃüÁÄÑÃâ»á¶ÔһЩÃüÁîÒÅÍü£¬²»¹ýlinuxÀïµÄmanÃüÁ¿ÉÒÔ°ïÎÒÃÇÕÒµ½ÏàÓ¦ÃüÁîµÄ´ó²¿·ÖµÄÓ÷¨ÃèÊö£¬¸ù¾ÝÕâ¸öman ......
»ù±¾¸ÅÄî
ORACLEÊý¾Ý¿â±»»®·Ö³É³Æ×÷Ϊ±í¿Õ¼äµÄÂß¼ÇøÓò——ÐγÉORACLEÊý¾Ý¿âµÄÂß¼½á¹¹¡£Ò»
¸öORACLEÊý¾Ý¿âÄܹ»ÓÐÒ»¸ö»ò¶à¸ö±í¿Õ¼ä,¶øÒ»¸ö±í¿Õ¼äÔò¶ÔÓ¦×ÅÒ»¸ö»ò¶à¸öÎïÀíµÄÊý¾Ý¿â
Îļþ¡£±í¿Õ¼äÊÇORACLEÊý¾Ý¿â»Ö¸´µÄ×îСµ¥Î»,ÈÝÄÉ×ÅÐí¶àÊý¾Ý¿âʵÌå,Èç±í¡¢ÊÓͼ¡¢Ë÷Òý
¡¢¾Û´Ø¡¢»ØÍ˶κÍÁÙʱ¶ÎµÈ¡£
ÿ¸öORACLEÊý¾ ......