OracleÐÐתÁÐʵÀý
ѪҺÃ÷ϸ±íÈçÏ£º
create table "blood"."OC_CarryOrderD" (
ID nvarchar2(20) not null,
"ProductCode" nvarchar2(10),
"BloodGroup" nvarchar2(10)
);
ÓбàºÅ£¬²úÆ·Àà±ðºÍѪÐÍÈý¸ö×Ö¶Î
Êý¾ÝÈçÏ£º
Òª¼ÆËãijһ²úÆ·µÄ²»Í¬ÑªÐ͵ĴüÊý
¾ÍÒª½«±íÐÐתÁУ¬×ö³ÉÈçÏÂЧ¹û£º
´úÂëÈçÏÂ
select productcode,
MAX(decode(rn, 1, codesum, NULL)) A,
MAX(decode(rn, 2, codesum, NULL)) AB,
MAX(decode(rn, 3, codesum, NULL)) B,
MAX(decode(rn, 4, codesum, NULL)) O
from
(
select productcode,bloodgroup,codesum,row_number() over(PARTITION BY productcode ORDER BY bloodgroup, codesum) rn from (
select productcode,bloodgroup, count(productcode) as codesum from oc_carryorderd2 group by productcode,bloodgroup order by bloodgroup)
)
group by productcode;
×¢Ò⣺ MAXºóÃæµÄÁÐÃû(A,AB,B,O)ҪעÒâ°´×Öĸ˳ÐòÅÅÁУ¬ÒòΪºóÃæµÄselectÓï¾äÊÇ°´ÑªÐÍ×Ö¶ÎÉýÐòÅÅÁеÄ
¶ÔÿÖÖ²úÆ·µÄ´üÊý×ö¸ö»ã×Ü£¬ÈçÏÂͼ
¿ÉÒÔÔÚMAXºóÃæ¼ÓÈë²éѯ×ֶΠsum(codesum)
Ïà¹ØÎĵµ£º
ORACLE 10gÏÂÔصØÖ·
Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit)
http://download.oracle.com/otn/nt/oracle10g/10201/10201_database_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_client_win32.zip
http://download.oracle.co ......
ÔÚSQL*PlusÖУº£¨1£©ÈçºÎÌí¼Óɾ³ýÊý¾Ý¿â£¿£¨2£©Êý¾Ý¿â¾ÍÊDZíÂ𣿣¿£¨3£©ÈçºÎ´´½¨±í¿Õ¼ä£¿£¨4£©ÈçºÎ´´½¨Óû§£¿£¨5£©ÊDz»ÊÇÒ»¸ö±í¿Õ¼äÖ»ÄÜ´´½¨Ò»¸öÓû§£¿£¨6£©ÔõÑù´Ó¿Í»§¶Ë·ÃÎÊÊý¾Ý¿â·þÎñÆ÷µÄÅäÖã¿
¡¡¡¡
¡¡¡¡»Ø´ð£º
¡¡¡¡1¡¢ºÎÌí¼Óɾ³ýÊý¾Ý¿â£¿Ã»ÕâÖÖ¸ÅÄ²»¶®¡£
¡¡¡¡2¡¢Êý¾Ý¿â=ËùÓеÄoracleµÄÊý¾ÝÎļþ+¿ØÖÆÎļþ+ÈÕÖ¾Îļ ......
¡¡¡¡select * from perexl order by nlssort(danwei,'NLS_SORT=SCHINESE_PINYIN_M');
¡¡¡¡-- °´²¿Ê×ÅÅÐò
¡¡¡¡select * from perexl order by nlssort(danwei,'NLS_SORT=SCHINESE_STROKE_M');
¡¡¡¡-- °´±Ê»ÅÅÐò
¡¡¡¡select * from perexl order by nlssort(danwei,'NLS_SORT=SCHINESE_RADICAL_M');
¡¡¡¡--ÅÅÐòºó»ñÈ¡µÚ ......
Ò»Ö±ÏëѧϰÈçºÎµÃµ½Êý¾Ý¿âµÄIOÊý¾Ý£¬ORIONÊÇÒ»¸ö²»´íµÄ·ÂÕæ²âÊÔOracle IOµÄ¹¤¾ß¡£
ÏÂÃæÊÇÎҵIJâÊԵIJ½Ö裺
1 ´ÓoracleµÄÍøÕ¾ÉÏÏÂÔØORIONµÄÈí¼þ£¨11.1.0.7£©
2 ½âѹorion_linux_x86-64.gz
3 ½¨Á¢²ÎÊýÎļþ mytest.lun£¬ ÕâÀïµÄÁгöµÄÊÇ·ÖÇøÉ豸£¬ÎÒÔÚÉÏÃ潨Á¢ÁËasmÎļþϵͳ¡£ÒòΪÓÐÊý¾ÝÔÚÀïÃ棬ËùÒÔÎÒÓÃwrite=0Ö»²âÊ ......
select name from v$datafile;
create dataspace tablespace datafile '/oracle/oradata/orcl/data01.dbf' size 1024m,'/oracle/oradata/orcl/data02.dbf' size 1024m autoextend on next 100m maxsize unlimited;
alter tablespace dataspace add datafile '/oracle/oradata/orcl/da ......