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

ORACLE WITH AS Ó÷¨

Ô­ÎÄ´«ËÍÃÅ£ºhttp://blog.csdn.net/wh62592855/archive/2009/11/06/4776631.aspx
¼ÇµÃÒÔÇ°ÔÚÂÛ̳Àï¿´µ½inthirtiesÓõ½¹ýWITH ASÕâ¸ö×ÖÑÛ£¬µ±Ê±Ã»ÌرðÔÚÒâ¡£½ñÌìÔÚÒ»¸öÌû×ÓÀïÓÖ¿´µ½ÓÐÈËÓÃÕâ¸ö£¬ËùÒÔ¾ÍÈ¥ÍøÉÏËÑÁËËÑÏà¹ØÄÚÈÝ£¬×Ô¼ºÐ¡ÊÔÁËÒ»°Ñ£¬Ð´ÏÂÀ´£¬·½±ãÒÔºóÍüÁ˵Ļ°Ñ§Ï°¡£
===================================================================================
ÏȾٸöÀý×Ó°É£º
ÓÐÁ½ÕÅ±í£¬·Ö±ðΪA¡¢B£¬ÇóµÃÒ»¸ö×ֶεÄÖµÏÈÔÚ±íAÖÐÑ°ÕÒ£¬Èç¹ûA±íÖдæÔÚÊý¾Ý£¬ÔòÊä³öA±íµÄÖµ£»Èç¹ûA±íÖв»´æÔÚ£¬ÔòÔÚB±íÖÐÑ°ÕÒ£¬ÈôB±íÖÐÓÐÏàÓ¦¼Ç¼£¬ÔòÊä³öB±íµÄÖµ£»Èç¹ûB±íÖÐÒ²²»´æÔÚ£¬ÔòÊä³ö"no records”×Ö·û´®¡£
with
sql1 as (select to_char(a) s_name from test_tempa),
sql2 as (select to_char(b) s_name from test_tempb where not exists (select s_name from sql1 where rownum=1))
select * from sql1
union all
select * from sql2
union all
select 'no records' from dual
where not exists (select s_name from sql1 where rownum=1)
and not exists (select s_name from sql2 where rownum=1);
Ôپٸö¼òµ¥µÄÀý×Ó
with a as (select * from test)
select * from a;
Æäʵ¾ÍÊÇ°ÑÒ»´ó¶ÑÖظ´Óõ½µÄSQLÓï¾ä·ÅÔÚwith as ÀïÃ棬ȡһ¸ö±ðÃû£¬ºóÃæµÄ²éѯ¾Í¿ÉÒÔÓÃËü
ÕâÑù¶ÔÓÚ´óÅúÁ¿µÄSQLÓï¾äÆðµ½Ò»¸öÓÅ»¯µÄ×÷Ó㬶øÇÒÇå³þÃ÷ÁË
ÏÂÃæÊÇËÑË÷µ½µÄÓ¢ÎÄÎĵµ×ÊÁÏ
About Oracle WITH clause
Starting in Oracle9i release 2 we see an incorporation of the SQL-99 “WITH clause”, a tool for materializing subqueries to save Oracle from having to re-compute them multiple times.
The SQL “WITH clause” is very similar to the use of Global temporary tables (GTT), a technique that is often used to improve query speed for complex subqueries. Here are some important notes about the Oracle “WITH clause”:
   • The SQL “WITH clause” only works on Oracle 9i release 2 and beyond.
   • Formally, the “WITH clause” is called subquery factoring
   • The SQL “WITH clause” is used when a subquery is executed multiple times
   • Also useful for re


Ïà¹ØÎĵµ£º

jdbcÁ¬½ÓOracle

      ËäȻѧϰJavaºÜ¾ÃÁË£¬×Ô¼ºÒ²Á¬½Ó¹ýһЩÊý¾Ý¿â£¬±ÈÈçmysqlÖ®ÀàµÄ£¬Èç½ñÄØ£¬Ò²Ñ§Ï°ÁËÒ»¶Îʱ¼äµÄOracle£¬È»¶øÄØ£¬½ñÌìÊÇÎÒµÚÒ»´ÎÁ¬½ÓOracle£¬ºÙºÙ£¬Ó¦¸Ã»¹²»ËãÌ«³Ù°É¡£
    ½ñÌìÄØ£¬Óе㱿׾£¬´ó¼ÒĪЦ£¡
    ÎÒÕâÊÇÒ»¸ö²éѯÀý×Ó
    Ê×ÏÈ£¬Ô ......

oracle¸´Ï°£¨¶þ£© Ö®À©Õ¹ ÉèÖÃÊý¾Ý¿âΪֻ¶Á

      ºÙºÙ£¬Õ⻹ÊÇÉÏÕÂ֪ʶÁË£¬Ö»Êǵ¥Ò»Ð´³öÀ´±È½ÏºÃÒ»µã£¬ÒòΪÉÏÃæµÄÊǽϻù´¡µÄ£¬²»ÔõôÉæ¼°²Ù×÷£¬¶øÕâÀïÊÇͨ¹ý²Ù×÷³öÀ´µÄ£¬ºÇºÇ¡£
      Ê×ÏÈ£¬´ò¿ªÊý¾Ý¿â·þÎñ£¬È»ºóͨ¹ý¿ØÖÆ̨´ò¿ªsqlplus£º
È»ºó½«Êý¾Ý¿âÉèÖÃΪֻ¶Á£ºalter database read only£»µ«ÊÇÄØ£¬ÕâÑùÊDz»Ä ......

ORACLE Ò»Ö¶Á(Consistent Read)µÄ²½Öè

1. Read the Data Block.
2. Read the Row Header.
3. Check the Lock Byte to determine whether there's an ITL entry.
4. Read the ITL entry to determine the Transaction ID (Xid).
5. Read the Transaction Table using the Transaction ID. If the transaction has been committed and has a System Commit ......

Windowsϳ£¼ûOracle·þÎñ½éÉÜ

ÄÇЩ·þÎñÐèÒªÆô¶¯ÐèÒª¿´Äã×Ô¼ºµÄÐèÇó£¬Ïê¼û£º
Windowsϳ£¼ûOracle·þÎñ½éÉÜ£º
£¨1£©OracleServiceSID                       
  Êý¾Ý¿â·þÎñ£¬Õâ¸ö·þÎñ»á×Ô¶¯µØÆô¶¯ºÍÍ£Ö¹Êý¾Ý¿â¡£Èç¹û°²×°ÁË ......

ORACLE RAC¹¤×÷Ô­Àí


ORACLE RAC¹¤×÷Ô­Àí
ORACLE RAC¹¤×÷Ô­Àí
¡¡¡¡ÔÚÒ»¸öÓ¦Óû·¾³µ±ÖУ¬ËùÓеķþÎñÆ÷ʹÓú͹ÜÀíͬһ¸öÊý¾Ý¿â£¬Ä¿µÄÊÇΪÁË·Öɢÿһ̨·þÎñÆ÷µÄ¹¤×÷Á¿£¬Ó²¼þÉÏÖÁÉÙÐèÒªÁ½Ì¨ÒÔÉϵķþÎñÆ÷£¬¶øÇÒ»¹ÐèÒªÒ»¸ö¹²Ïí´æ´¢É豸¡£Í¬Ê±»¹ÐèÒªÁ½ÀàÈí¼þ£¬Ò»¸öÊǼ¯ÈºÈí¼þ£¬ÁíÍâÒ»¸ö¾ÍÊÇOracleÊý¾Ý¿âÖеÄRAC×é¼þ¡£Í¬Ê±ËùÓзþÎñÆ÷ÉϵÄOS¶¼Ó¦¸ÃÊÇÍ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ