Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Oracle×ܽá

Ò».OracleÊý¾Ý¿âÖг£ÓõÄÊý¾ÝÀàÐÍ
varchar2(³¤¶È)¿É±ä³¤×Ö·û´®
char(³¤¶È) ¶¨³¤
number()±íʾÕûÊý»òÕ߸¡µãÊýnumber(8) number(8,2)
clog ×Ö·ûµÄ´ó¶ÔÏó
blog ¶þ½øÖƵĴó¶ÔÏó
¶þ.Êý¾Ý¿â²éѯ
1£©SELECTÓï¾ä
´Ó±íÖÐÌáÈ¡²éѯÊý¾Ý.Ó﷨ΪSELECT [DISTINCT] {column1,column2,…} from tablename WHERE {conditions} GROUP BY {conditions} ORDER BY {expressions} [ASC/DESC];
˵Ã÷£ºSELECT×Ó¾äÓÃÓÚÖ¸¶¨¼ìË÷Êý¾Ý¿âµÄÖÐÄÄЩÁУ¬from×Ó¾äÓÃÓÚÖ¸¶¨´ÓÄÄÒ»¸ö±í»òÊÓͼÖмìË÷Êý¾Ý¡£
2£©WHERE×Ӿ䡣
WHERE×Ó¾äÓÃÀ´Ñ¡Ôñ·ûºÏÌõ¼þµÄµÄ¼Ç¼.
like '...' ͨÅä²éѯ _,%
between ... and ... ,±íʾ½á¹ûÔÚÕâÖ®¼ä£¬between andÊÇÒ»¸ö±ÕÇø¼ä¡£
!=£¬<>£¬^=£¬ÕâÈý¸ö¶¼¿ÉÒÔ±íʾ²»µÈÓÚ¡£
in (va1,val2,...) ÅжϽá¹ûÊÇ·ñÔÚÕâ¸ö¼¯ºÏÖдæÔÚ ¡£
like '...' ×Ö·û´®Í¨Åä²éѯ£¬'%'±íʾ0»ò¶à¸ö×Ö·û£¬'_'±íʾһ¸ö×Ö·û¡£
... and ... ±íʾֻÓÐÁ½¸öÌõ¼þͬʱÂú×ã
... or ... ±íʾÌõ¼þÖ»ÒªÂú×ãÆäÖÐÖ®Ò»¾Í¿ÉÒÔ
all ... ÊÇÒªÇó¶¼Âú×ãÌõ¼þ¡£
not .....£¬ÔòÊÇ¿ÉÒÔÓëÒÔÉϵÄÌõ¼þ²úÉú·´Ð§¹û¡£
... is null ʹÓÃÀ´ÅжÏÖµÊDz»ÊÇ¿Õ¡£
3) ORDER BY×Ó¾ä
ORDER BY ×Ó¾äʹµÃSQLÔÚÏÔʾ²éѯ½á¹ûʱ½«¸÷·µ»ØÐа´Ë³ÐòÅÅÁУ¬·µ»ØÐеÄÅÅÁÐ˳ÐòÓÉORDER BY ×Ó¾äÖ¸¶¨µÄ±í´ïʽµÄֵȷ¶¨¡£
ASC£¨Ä¬ÈÏ£¬ÉýÐò£© DESC£¨½µÐò£©
order by Ä¿±êÁÐÃû£¨±ðÃû£© ÅÅÐò˳Ðò£¨²»Ð´ÅÅÐò˳Ðò£¬»áĬÈÏΪÉýÐòÅÅÐò£©
Àý£ºselect first_name from s_emp order by first_name;
select first_name from s_emp order by first_name desc;
Èý.SQL³£ÓõÄÃüÁî·ÖÀ༰Àý×Ó
Êý¾Ý¶¨ÒåÓïÑÔ£ºcreate£¨´´½¨£©¡¢alter£¨¸ü¸Ä£©ºÍdrop£¨É¾³ý£©ÃüÁî¡£
Êý¾Ý²Ù×ÝÓïÑÔ£ºinsert£¨²åÈ룩¡¢select£¨Ñ¡Ôñ£©¡¢delete£¨É¾³ý£©ºÍupdate£¨¸üУ©ÃüÁî¡£
ÊÂÎñ¿ØÖÆÓïÑÔ£ºcommit£¨Ìá½»£©¡¢savepoint£¨±£´æµã£©ºÍrollback£¨»Ø¹ö£©ÃüÁî¡£
Êý¾Ý¿ØÖÆÓïÑÔ£ºgrant£¨ÊÚÓ裩ºÍrevoke£¨»ØÊÕ£©¡£
1.Êý¾Ý¶¨ÒåÓïÑÔ¾ÙÀý£º
SQL> create table myTab(no number(4),name varchar2(20));´´½¨Ò»¸öÃûΪmyTabµÄ±í£¬°üº¬Á½ÁÐnoºÍname£»
SQL> alter table myTab modify (name varchar2(25));ÐÞ¸ÄmyTabÖеÄnameÁУ¬Ê¹´ËÁÐÄÜÈÝÄÉ25¸ö×Ö·û£»
SQL> alter table myTab add (tel_no varchar2(20));¸ø±ímyTabÔö¼ÓÒ»ÁÐtel_no£»
SQL> alter table myTab drop column tel_no;ɾ³ý±ímyTabµÄtel_noÁÐ;
SQL&g


Ïà¹ØÎĵµ£º

Oracle DBLinkµÄʹÓÃ


ÔÚ×öÓ¦ÓÃϵͳ¿ª·¢Ê±£¬ÎÒÃÇ»áÓöµ½Ò»¸öÎÊÌ⣬¾ÍÊÇÎÒÃÇÓ¦ÓÃϵͳÓÐЩÊý¾ÝÐèÒª´ÓÆäËûÊý¾Ý¿âµÄijһÕűíÄõ½Êý¾Ý£¬ÄÇÎÒÃÇÓ¦¸ÃÔõô°ì£¿±ÈÈ磺×Ó¹«Ë¾µÄÏúÊÛϵͳÐèÒª´Ó¹ãÖÝ×ܲ¿ÈËÁ¦×ÊÔ´¹ÜÀíϵͳµÄÊý¾Ý¿âµ±ÖлñÈ¡×îеÄÓû§ÐÅÏ¢£¬ÄÇÎÒÃÇÓ¦¸ÃÔõôʵÏÖ£¿ÊµÏÖÏÖÔÚµÄ×ö·¨Óкܶ࣬¿ÉÒÔͨ¹ýWebService·½Ê½»ñÈ¡£¬µ«¿ª·¢³É±¾»¹ÊDZȽϸߣ¬¼ÙÉè ......

sql serverºÍoracleµÄÇø±ð

1£®OracleΪ¿Í»§¶Ë¿ªÆô»á»°ÓÐÁ½ÖÖ·½Ê½£º¹²Ïí·þÎñºÍרÓ÷þÎñ¡£ÔÚרÓ÷þÎñÇé¿öÏ£¬¼àÌýÆ÷ΪÁ¬½ÓÇëÇó´´½¨Ð½ø³Ì£¨Unix»·¾³ÏÂÊÇProcess£¬WindowsÏÂÎÒÏëÓ¦¸ÃÊÇThread°É£©£»¹²Ïí·þÎñÇé¿öÏ£¬¼àÌýÆ÷½«¿Í»§ÇëÇ󽻸øDispatcher£¬ÓÉDispatcher°²ÅŶà¿Í»§µÄ×÷Òµ¡£SQL ServerÔÚĬÈÏÇé¿öÏÂ×Ô¶¯Îª¿Í»§¶ËÁ¬½Ó´´½¨Ị̈߳¬µ±Óзdz£¶àµÄ¿Í ......

×Ô¼ºÐ´µÄoracle´æ´¢¹ý³Ì»áÓõ½

create or replace procedure prc_statistic_declare(table_name varchar2 ,table_name_pass varchar2 ,not_exist varchar2,not_exist_record varchar2)
--eg:'t_statistic_bianyuanhu_month',t_statistic_bianyuanhu_month,('YEAR','STATISTIC_ID')','YESR'
is
   v_sql_column varchar2(1000);
   ......

oracle¡¢proxool¡¢hibernateʹÓÃ×ܽá

¿ªÊ¼ÔÚmyeclipse6.5ÖÐDB BROWERн¨ÁËÒ»¸öÊý¾Ý¿âÁ¬½Ó£¬Èçͼ£º
Ò»Á¬½Ó£¬±¨³öÁËÁ½¸ö´íÎó£º
1. ORA-00604 error occurred at recursive SQL level string.
2.ORA-12705: invalid or unknown NLS parameter value.
²é×ÊÁϺó½â¾ö£¨ÆÚ¼äÎÒ»¹¸Ä¹ýtestÓû§µÄÁ¬½ÓȨÏÞ£©£º
½«MyEclipseÖÐeclipseĿ¼ÏµÄeclipse.iniÎļþ£¬° ......

Oracleѧϰ±Ê¼Ç3 ¼òµ¥²éѯ

±íµÄ²éÕÒ£º
select * from emp where (sal>500 or job='MANAGER') and ename like 'J%';
ÒýºÅÀï±ßµÄ×Ö·ûÊÇÇø·Ö´óСдµÄ¡£
²éÕÒÖ®ºó°Ñ½á¹ûÅÅÐò£º
select * from emp order by sal asc;
ascÊÇÉýÐò£¬descÊǽµÐò
 
¶ÔÁÐÖØÃüÃû£¬Ö»Òª´ò¸ö¿Õ¸ñ£¬ºó¸úÐÂÁÐÃû¾Í¿ÉÒÔ
select ename,sal*12+nvl(comm,0)*12 "Äêн" from ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ