oracleÊÇ·ñÓÐÕâÑùµÄº¯Êý - Oracle / »ù´¡ºÍ¹ÜÀí
Êý¾Ý±íÈçÏÂ:
²úÆ·Ãû³Æ 2ÔÂÏúÁ¿ÅÅÃû 1ÔÂÏúÁ¿ 2ÔÂÏúÁ¿ 3ÔÂÏúÁ¿ 4ÔÂÏúÁ¿ 5ÔÂÏúÁ¿ 6ÔÂÏúÁ¿ 7ÔÂÏúÁ¿ 8ÔÂÏúÁ¿... 12ÔÂÏúÁ¿
ÓÐûÓк¯ÊýÄܽ«µÚ¶þ×ֶΣ¨2ÔÂÏúÁ¿ÅÅÃû£©µÄÖµÇó³öÀ´£¬¡¾2ÔÂÏúÁ¿ÅÅÃû¡¿ÊÇ2ÔÂÔÚÒ»Äê12¸öÔÂÖеÄÏúÁ¿ÅÅÃû
--tableΪ±íÃû
--p_monÔ·ݲÎÊý Ϊ1ÔÂ,2ÔÂ.........12ÔÂ
--Èç¹ûlzÖ»ÊÇÏëÇó³ö2Ô嵀 ÄǾͰÑp_monдËÀ°É
create or replace function fun(p_mon in varchar2) return number is
Result number;
declare
p_rank number;
begin
select rn into p_rank
from (select mon, rownum rn
from (select mon
from (select '1ÔÂ' mon, 1ÔÂÏúÁ¿ sale
from table
union all
select '2ÔÂ' mon, 2ÔÂÏúÁ¿ sale
from table
union all
select '3ÔÂ' mon, 3ÔÂÏúÁ¿ sale
from table
union all
select '4ÔÂ' mon, 4ÔÂÏúÁ¿ sale
from table
union all
select '5ÔÂ' mon, 5ÔÂÏúÁ¿ sale
from table
union all
select '6ÔÂ' mon, 6ÔÂÏúÁ¿ sale
Ïà¹ØÎÊ´ð£º
ÎÒÔÚ¿ª·¢µÄÕâ¸öÓ¦Óò¢·¢ÐԱȽϸߣ¬oracle¸üÐÂÊý¾ÝʱºòÈçºÎ´¦Àí²¢·¢´¦ÀíÄØ£¿¸÷λ´óÏÀ·¢±íºÃµÄ¹Ûµã°¡£¬ÔÚÏߵȴý£¡
oracleÊý¾Ý¸üÐÂʱ£¬»á×Ô¶¯Ä¬ÈÏÐÐËø¶¨£¬Â¥Ö÷²»Òª²ÙÐÄ£¬Oracle¶Ô²¢Ðд¦ÀíÒѾºÜ³ÉÊìÁË
ÒýÓÃ
oracle ......
ллÌÆÈËÀÏ´óµÄÖ¸µã£¬Ð»Ð»¸÷λ¸ßÊÖµÄÖ¸µã£¡
°²×°10g Enterprise¡£ÉÏÍøÏÂÁËMLDNµÄOracleÊÓƵ£¬¸ú×ÅÊÓƵÉϵÄÅäÖÃ×ߣ¬°²×°³É¹¦ÁË£¬µ«ÊÇûÍêÕûµØÅäÖá£
µã»÷½øÈ룺Database Configuration Assistant
1. ´´½¨Êý¾Ý¿â£»
......
ORACLEÅàѵ(OCA)ÈÏÖ¤½éÉÜ
Oracle10g Certified Associate (OCA) Oracle ÈÏ֤רԱ¡£
¿¼ÊԳɼ¨Í¨¹ýÄÜ»ñµÃOracle¹«Ë¾ÎªÄú°ä·¢µÄÈ«ÇòÈÏÖ¤µÄÓ¢ÎÄOCAÖ¤Êé¡£OCAÓÉOracle¹«Ë¾³öÌâ¡£
¸ÃÖ¤Êé¿É×÷Ϊ¸÷ÆóÊÂÒµµ¥Î»Êý¾Ý¿ ......
ÕâÀïÏëÁ˽âÏ£¬¹ØÓÚSQL ServerÖзÖÒ³ºÍOracleÖзÖÒ³£»
ƽ³£Ð´Ó¦ÓóÌÐòµÄʱºò£¬±ÈÈçÓõÄÓïÑÔÊÇJava£¬ÓиöÁбíÒ³Ã棬ÐèÒª¶ÔÊý¾Ý·ÖÒ³ÏÔʾ£»
ÕâÀïÒª·ÖÒ³ÄѵÀ²»ÐèÒª½èÖúJava£¬¶øÖ±½ÓsqlÄÜÖªµÀ·ÖÒ³Âð£¬ÆðÂëÒ²Òª´«¸öÒ³Âë½ ......
select distinct '1' t1,'2' t2,'3' t3,'4' t4 from table ²é³öÀ´µÄ½á¹ûΪ
1,2,3,4
ÎÒÏëµÃÒÔÏÂÕâÑùµÄЧ¹û
1
2
3
4
ÇëÎÊÒ»ÏÂÓÐʲô°ì·¨¿ÉÒÔ½â¾ö???
ûÓкõķ½·¨£¬ÓÃunion£¬Ò»ÌõÌõ¼Ç¼ƴ½Ó
SQL code:
wi ......