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

OracleµÄ¼¸¸ö¼¯ºÏ²Ù×÷

 
Union£¬¶ÔÁ½¸ö½á¹û¼¯½øÐв¢¼¯²Ù×÷£¬²»°üÀ¨Öظ´ÐУ¬Í¬Ê±½øÐÐĬÈϹæÔòµÄÅÅÐò£»
Union All£¬¶ÔÁ½¸ö½á¹û¼¯½øÐв¢¼¯²Ù×÷£¬°üÀ¨Öظ´ÐУ¬²»½øÐÐÅÅÐò£»
Intersect£¬¶ÔÁ½¸ö½á¹û¼¯½øÐн»¼¯²Ù×÷£¬²»°üÀ¨Öظ´ÐУ¬Í¬Ê±½øÐÐĬÈϹæÔòµÄÅÅÐò£»
Minus£¬¶ÔÁ½¸ö½á¹û¼¯½øÐвî²Ù×÷£¬²»°üÀ¨Öظ´ÐУ¬Í¬Ê±½øÐÐĬÈϹæÔòµÄÅÅÐò¡£
¿ÉÒÔÔÚ×îºóÒ»¸ö½á¹û¼¯ÖÐÖ¸¶¨Order by×Ó¾ä¸Ä±äÅÅÐò·½Ê½:
select score,id,name
from student
where id > 2 and id < 7
union
select score,id,name
from student
where id < 4
union
select score,id,name
from student
where id > 8
order by id desc


Ïà¹ØÎĵµ£º

oracle ±í¿Õ¼ä²Ù×÷

oracle±í¿Õ¼ä²Ù×÷Ïê½â
  1
  2
  3×÷Õߣº   À´Ô´£º    ¸üÐÂÈÕÆÚ£º2006-01-04 
  5
  6 
  7½¨Á¢±í¿Õ¼ä
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

ORACLE TRUNC()º¯Êý

 ÒÔÉÏΪתÔØ,¶àÊý²¢Î´ÑéÖ¤.
ÆäÖÐ,select trunc(sysdate,'dd') from dual,µÃµ½µÄÊÇ: 2009-3-23 ÉÏÎç12:00:00 ,ÓëÏÂÎIJ¢²»Ò»Ñù!
oracle trunc()º¯ÊýµÄÓ÷¨
1.TRUNC(for dates)
TRUNCº¯ÊýΪָ¶¨ÔªËضø½ØÈ¥µÄÈÕÆÚÖµ¡£
Æä¾ßÌåµÄÓï·¨¸ñʽÈçÏ£º
TRUNC£¨date[,fmt]£©
ÆäÖУº
date Ò»¸öÈÕÆÚÖµ
fmt ÈÕÆÚ¸ñʽ£¬¸ÃÈÕÆÚ½« ......

Oracle×Ö·û¼¯ÐÞ¸ÄÎÊÌâ

 ¾­³£ÓÐͬÊÂ×ÉѯoracleÊý¾Ý¿â×Ö·û¼¯Ïà¹ØµÄÎÊÌ⣬ÈçÔÚ²»Í¬Êý¾Ý¿â×öÊý¾ÝǨÒÆ¡¢Í¬ÆäËüϵͳ½»»»Êý¾ÝµÈ£¬³£³£ÒòΪ×Ö·û¼¯²»Í¬¶øµ¼ÖÂǨÒÆʧ°Ü»òÊý¾Ý¿âÄÚÊý¾Ý±ä³ÉÂÒÂë¡£ÏÖÔÚÎÒ½«oracle×Ö·û¼¯Ïà¹ØµÄһЩ֪ʶ×ö¸ö¼òµ¥×ܽᣬϣÍû¶Ô´ó¼Ò½ñºóµÄ¹¤×÷ÓÐËù°ïÖú¡£
¡¡¡¡Ò»¡¢Ê²Ã´ÊÇoracle×Ö·û¼¯
¡¡¡¡Oracle×Ö·û¼¯ÊÇÒ»¸ö×Ö½ÚÊý¾ÝµÄ½âÊÍ ......

Oracleʱ¼äÀàÐÍÊý¾ÝΪ0µÄBug

¿ª·¢×éÔÚÊý¾ÝǨÒÆʱ£¬±¨¸æ·¢ÏÖһЩÊýֵΪ'0000/00/00'µÄdateÊý¾Ý£¬µ¼ÖÂÊý¾ÝǨÒÆʧ°Ü¡£
Õâ¸öÎÊÌâÓеãÆæ¹Ö£¬ÒòΪÔÚOracleÖУ¬dateÀàÐ͵ÄÊý¾ÝµÄÈ¡Öµ·¶Î§ÊÇ´Ó-4712/12/31µ½9999/12/31Ö®¼ä£¬²¢ÇÒÄê·Ý²»ÄÜΪ0¡£Ò²¾ÍÊÇ˵'0000/00/00'ÊÇÒ»¸ö·Ç·¨Êý¾Ý£¬²»ÎªOracleËù½ÓÊÜ¡£
 
SQL> select to_date('0000-00-00', 'yyyy-mm- ......

Oracle ²ÎÊýÎļþ×ܽá

1:pfileºÍspfile
ÔÚ9i֮ǰ£¬²ÎÊýÎļþÖ»ÓÐÒ»ÖÖ£¬ËüÊÇÎı¾¸ñʽµÄ£¬³ÆΪpfile£¬ÔÚ9i¼°ÒÔºóµÄ°æ±¾ÖУ¬ÐÂÔöÁË·þÎñÆ÷²ÎÊýÎļþ,³ÆΪspfile,ËüÊǶþ½øÖƸñʽµÄ¡£ÕâÁ½ÖÖ²ÎÊýÎļþ¶¼ÊÇÓÃÀ´´æ´¢²Î ÊýÅäÖÃÒÔ¹©oracle¶ÁÈ¡µÄ£¬µ«Ò²Óв»Í¬µã£¬×¢ÒâÒÔϼ¸µã£º
1)pfileÊÇÎı¾Îļþ£¬spfileÊǶþ½øÖÆÎļþ£»
2)¶ÔÓÚ²ÎÊýµÄÅäÖã¬pfile¿ÉÒÔÖ±½ÓÒÔÎ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ