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

oracle distinct

oracle distinct
¹Ø¼ü×Ö: distinctµÄһЩÔÓ̸
distinctÕâ¸ö¹Ø¼ü×ÖÀ´¹ýÂ˵ô¶àÓàµÄÖØ¸´¼Ç¼ֻ±£ÁôÒ»Ìõ£¬µ«ÍùÍùÖ»Óà ËüÀ´·µ»Ø²»Öظ´¼Ç¼µÄÌõÊý£¬¶ø²»ÊÇÓÃËüÀ´·µ»Ø²»ÖؼǼµÄËùÓÐÖµ¡£ÆäÔ­ÒòÊÇdistinctÖ»ÓÐÓöþÖØÑ­»·²éѯÀ´½â¾ö£¬¶øÕâÑù¶ÔÓÚÒ»¸öÊý¾ÝÁ¿·Ç³£´óµÄÕ¾À´Ëµ£¬ÎÞÒÉÊÇ»áÖ±½ÓÓ°Ï쵽ЧÂʵġ£
ÏÂÃæÏÈÀ´¿´¿´Àý×Ó£º
table±í
×Ö¶Î1     ×Ö¶Î2
   id        name
   1           a
   2           b
   3           c
   4           c
   5           b
¿â½á¹¹´ó¸ÅÕâÑù£¬ÕâÖ»ÊÇÒ»¸ö¼òµ¥µÄÀý×Ó£¬Êµ¼ÊÇé¿ö»á¸´Ôӵöࡣ
±ÈÈçÎÒÏëÓÃÒ»ÌõÓï¾ä²éѯµÃµ½name²»Öظ´µÄËùÓÐÊý¾Ý£¬ÄǾͱØÐëʹÓÃdistinctÈ¥µô¶àÓàµÄÖØ¸´¼Ç¼¡£
select distinct name from table
µÃµ½µÄ½á¹ûÊÇ:
 
---------- 
name
   a
   b
   c
ºÃÏñ´ïµ½Ð§¹ûÁË£¬¿ÉÊÇ£¬ÎÒÏëÒªµÃµ½µÄÊÇidֵĨ£¿¸ÄһϲéѯÓï¾ä°É:
select distinct name, id from table
½á¹û»áÊÇ:
---------- 
id name
   1 a
   2 b
   3 c
   4 c
   5 b
distinctÔõôûÆð×÷Óã¿×÷ÓÃÊÇÆðÁ˵쬲»¹ýËûͬʱ×÷ÓÃÁËÁ½¸ö×ֶΣ¬Ò²¾ÍÊDZØÐëµÃidÓëname¶¼ÏàͬµÄ²Å»á±»Åųý¡£¡£¡£¡£¡£¡£¡£
ÎÒÃÇÔٸĸIJéѯÓï¾ä:
select id, distinct name from table
ºÜÒź¶£¬³ýÁË´íÎóÐÅÏ¢ÄãʲôҲµÃ²»µ½£¬distinct±ØÐë·ÅÔÚ¿ªÍ·¡£Äѵ½²»ÄܰÑdistinct·Åµ½whereÌõ¼þÀÄÜ£¬ÕÕÑù±¨´í¡£
------------------------------------------------------------------------------------------------------------
ÏÂÃæ·½·¨¿ÉÐÐ:
select *, count(distinct name) from table group by name
½á¹û:
   id name count(distinct name)
   1 a 1
   2 b 1
   3 c 1
×îºóÒ»ÏîÊǶàÓàµÄ£¬²»ÓùܾÍÐÐÁË£¬Ä¿µÄ´ïµ½¡£¡£¡£¡£¡£
group by ±ØÐë·ÅÔÚ order by ºÍ limit֮ǰ£¬²»È»»á±¨´í
================


Ïà¹ØÎĵµ£º

oracleÁ¬½ÓÊý¾Ý¿â²âÊÔ´úÂë

oracleÁ¬½ÓÊý¾Ý¿â²âÊÔ´úÂë
/**
*
* ˵Ã÷£º
* £¨1£©±¾ÀýʹÓÃJDBC_ODBCÇŽøÐÐÊý¾Ý¿âÁ¬½Ó£¬¹Ê´ËÐèÒªODBCÊý¾ÝÔ´
* £¨2£©±¾ÀýÖÐSQLΪ¸üÐÂÓï¾ä£¬¹Ê´ËʹÓÃÔØÌåµÄexecuteUpdate·½·¨£¬²¢ÇÒ·µ»ØÊÜÓ°Ïì¼Ç¼Êý
* (3) ÅäÖÃÁ¬½ÓORACLEµÄodbcÊý¾ÝÔ´ora
*/ ......

Oracle´Ó·Ç¹éµµÄ£Ê½±ä³É¹éµµÄ£Ê½

http://www.cuijie.net.cn/?cat=6
¸ü¸ÄÊý¾Ý¿âµÄ¹éµµÄ£Ê½ÐèÒªÖØÐÂÆô¶¯Êý¾Ý¿â£¬ÔÚmountģʽÏÂÐ޸쬼òÒª²½Öè
1   ÒÔshutdown immediate ·½Ê½¹Ø±ÕÊý¾Ý¿â
2  Æô¶¯ÊµÀýµ½mount״̬
3  ¸ü¸ÄÔËÐÐģʽ²¢´ò¿ªÊý¾Ý¿â
²Ù×÷²½Ö裺
1   µÇ¼Êý¾Ý¿â²é¿´Êý¾Ý¿âµÄ¹éµµ×´Ì¬
     S ......

Oracle 10g upgrade from 10.2.0.1 to 10.2.0.4


 
   а²×°ÁËһ̨Êý¾Ý¿â·þÎñÆ÷£¬°æ±¾ÊÇ10.2.0.1µÄ£¬ÒòΪÏÖÔÚ×îеÄÊÇ10.2.0.4µÄ¡£ °æ±¾µÍÁË£¬bug¶à¡£ËùÒԾͶÔÊý¾Ý¿â×öÁËÒ»¸öÉý¼¶¡£
   ·þÎñÆ÷ÊÇwindows 2003µÄϵͳ£¬¶¼ÊÇ¿ÉÊÓ»°²Ù×÷¡£ ÏÂÒ»²½µÄÎÊÌâ¡£ 10.2.0.4µÄpatchset ÀïÃæÒ²ÓÐÏêϸµÄ°²×°ËµÃ÷¡£ Ö®×ö¸ö×ܽá ......

oracle¿Í»§¶Ë Á¬½ÓPL/SQL

oracle¿Í»§¶Ë  Á¬½ÓPL/SQL
ÏÂÔØ¿Í»§¶Ëµ½Ä³¸ö·¾¶
ÐÞ¸ÄÅäÖÃÎļþ
D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
# tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
SQLCLUB =
  (DESCRIPTION ......

oracle sqlÓï¾äÓÅ»¯»ù´¡

¾¡Á¿ÉÙÓÃIN²Ù×÷·û£¬»ù±¾ÉÏËùÓеÄIN²Ù×÷·û¶¼¿ÉÒÔÓÃEXISTS´úÌæ¡£
²»ÓÃNOT IN²Ù×÷·û£¬¿ÉÒÔÓÃNOT EXISTS»òÕßÍâÁ¬½Ó+Ìæ´ú¡£
OracleÔÚÖ´ÐÐIN×Ó²éѯʱ£¬Ê×ÏÈÖ´ÐÐ×Ó²éѯ£¬½«²éѯ½á¹û·ÅÈëÁÙʱ±íÔÙÖ´ÐÐÖ÷²éѯ¡£¶øEXISTÔòÊÇÊ×Ïȼì²éÖ÷²éѯ£¬È»ºóÔËÐÐ×Ó²éѯֱµ½ÕÒµ½µÚÒ»¸öÆ¥ÅäÏî¡£NOT EXISTS±ÈNOT INЧÂÊÉԸߡ£µ«¾ßÌåÔÚÑ¡ÔñIN»òEXIST² ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ