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)
Ïà¹ØÎĵµ£º
Update SQLS will lead dead lock exception. Because by default, it use optimistic lock but not pessimistic lock.
Below description is exceprted from the attachment(It exceeds my image that this blog can not upload the attachment,hehe)
Optimistic locking offers an elegant solution to the problems o ......
ÔÚSQL*PlusÖУº£¨1£©ÈçºÎÌí¼Óɾ³ýÊý¾Ý¿â£¿£¨2£©Êý¾Ý¿â¾ÍÊDZíÂ𣿣¿£¨3£©ÈçºÎ´´½¨±í¿Õ¼ä£¿£¨4£©ÈçºÎ´´½¨Óû§£¿£¨5£©ÊDz»ÊÇÒ»¸ö±í¿Õ¼äÖ»ÄÜ´´½¨Ò»¸öÓû§£¿£¨6£©ÔõÑù´Ó¿Í»§¶Ë·ÃÎÊÊý¾Ý¿â·þÎñÆ÷µÄÅäÖã¿
¡¡¡¡
¡¡¡¡»Ø´ð£º
¡¡¡¡1¡¢ºÎÌí¼Óɾ³ýÊý¾Ý¿â£¿Ã»ÕâÖÖ¸ÅÄ²»¶®¡£
¡¡¡¡2¡¢Êý¾Ý¿â=ËùÓеÄoracleµÄÊý¾ÝÎļþ+¿ØÖÆÎļþ+ÈÕÖ¾Îļ ......
C#ʹÓÃSystem.Data.OracleClientÁ¬½ÓOracleÊý¾Ý¿â¡£Ö®Ç°ÔÚWinXPÉÏÕý³£ÔËÐеijÌÐòÒÆÖ²µ½ Windows 2008 x64ÉÏÖ®ºó¾ÍÁ¬²»ÉÏÊý¾Ý¿âÁË£¬´íÎóÐÅÏ¢ÈçÏ£º
³¢ÊÔ¼ÓÔØ Oracle¿Í»§¶Ë¿âʱÒý·¢BadImageFomatException¡£Èç¹ûÔÚ°²×°32λOracle¿Í»§¶Ë×é¼þµÄÇé¿öÏÂÒÔ64λģʽÔËÐУ¬½«³öÏÖ´ËÎÊÌâ¡£
´íÎóÔÒòÊÇÔÀ´WinXP»ú×ÓÉÏËù°²×°µÄOrac ......
oracle³£Óú¯Êý-----------------------------------------------
SQLÖеĵ¥¼Ç¼º¯Êý
1.ASCII
·µ»ØÓëÖ¸¶¨µÄ×Ö·û¶ÔÓ¦µÄÊ®½øÖÆÊý;
SQL> select ascii(’A’) A,ascii(’a’) a,ascii(’0’) zero,ascii(’ ’) space from dual;
A A ZERO SPACE
--------- --------- - ......
±¾ÒëÎIJÉÓÃ֪ʶ¹²ÏíÊðÃû-·ÇÉÌÒµÐÔʹÓÃ-Ïàͬ·½Ê½¹²Ïí 3.0 UnportedÐí¿ÉÐÒé·¢²¼£¬×ªÔØÇë±£Áô´ËÐÅÏ¢
ÒëÕߣºÂí³ÝÜÈ | Á´½Ó£ºhttp://www.dbabeta.com/2010/oracle-sql-server-comparison-i.html
×÷ÕߣºSadequl Hussain | ÔÎÄ£ºhttp://www.sql-server-performance.com/articles/dba/oracle_sql_server_comparison_p1.aspx
Ò» ......