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

ÔÚOracleÖÐÈçºÎÈ¥µôÕâÑùµÄÖØ¸´ÐÐ - Oracle / ¸ß¼¶¼¼Êõ

ÔÚOracleÖвéѯµÃµ½ÀàËÆÕâÑùµÄ½á¹û£º
a b ab
1 2 1,2
2 1 2,1
ÈçºÎÈ¥µôÆäÖÐÈÎÒâÒ»Ìõ¼Ç¼
select * from table1 t
where not exists(
  select 1 from table1 where a=t.b and b=t.a and a>t.a)

SQL code:
with temp as(
select 1 a,2 b,'1,2' ab from dual
union all
select 2 a,1 b,'2,1' ab from dual
)
select * from temp where a = (round(dbms_random.value)+1)


ÒýÓÃ
select * from table1 t
where not exists(
select 1 from table1 where a=t.b and b=t.a and a>t.a)

ÒýÓÃһϿñÀ˵쬏ÄÒ»ÏÂ:
delete from table1 t
where exists(
  select 1 from tmp where a=t.b and b=t.a and a<t.a)

and rownum=1 ¼Ó¸öÕâ¸ö
¾ÍÑ¡³öÒ»ÌõÁË,

ÒýÓÃ
ÔÚOracleÖвéѯµÃµ½ÀàËÆÕâÑùµÄ½á¹û£º
a b ab
1 2 1,2
2 1 2,1
ÈçºÎÈ¥µôÆäÖÐÈÎÒâÒ»Ìõ¼Ç¼


Â¥Ö÷µÄÃèÊö¸úÎÊÌâÑÏÖØ²»·ûºÏ°¡£¡

¸ù¾ÝÎÊÌâÃèÊö£¬È¥µôÈÎÒâÒ»Ðеϰ£¬delete from tb where rownum=1; ¾ÍºÃÁË¡£

ÖÁÓÚÖØ¸´ÐмǼȥµôµÄ£¬Òª¿´Óм¸¸ö×ֶΣ¬²ÅºÃдsqlÓï¾ä£¬¼ÓÈëÄã±ítb ÓÐidÖ÷¼ü¡¢c1¡¢c2¡¢c3¡£ÄÇÃ´ÖØ¸´µÄ¼Ç¼¾ÍÊÇc1¡¢c2¡¢c3×Ö¶ÎÖØ¸´°É¡£
ÄÇôɾ³ýÖØ¸´ÐеÄsql¾ÍÊÇ
delete from tb t2
where exists(select 1 from tb t1 where t1.c1=t2.c1 and t1.c2=t2.c2 and t1.c3=t2.c3 and t1.id<>t2


Ïà¹ØÎÊ´ð£º

Çë½ÌsqlÓï¾ä¡£ - Oracle / ¿ª·¢

ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
  ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......

OracleµÄblob×Ö¶ÎÎÊÌâ - Oracle / ¿ª·¢

²éÁËÒ»ÌìµÄblob£¬»¹ÊÇûÀí½âµ½£¬ÎÒÏëÔÚVCÏ´æÈ¡¶þ½øÖƵÄÎļþ£¬Ê¹ÓõÄÊÇoo4o£¬ÕÕ×ŰïÖúÎĵµÉÏÃæµÄдÁËдÈëÊý¾Ý¿âµÄ´úÂ룬»¹ÊÇûд¶Ô£¬´íÎóÌáʾÊÇthis operation is not permitted on a empty LOB£¬ÕâÊÇʲôÒâ˼°¡£¿ÕÕ ......

[Ô­´´] ORACLE Á¬½Ó×Ö´® - Oracle / ·Ç¼¼ÊõÇø

¼ÙÉètable01 ÖÐÓÐ ÒÔÏÂ×ÊÁÏ
emp_no emp_name
------- ------------
0001 TOM
0002 JOHN
0003 MARY
³£Óõ绰 
¶øÎÒÃÇÒªµÃµ½ÒÔϵÄOUTPUT (»òÊǸ÷ÖÖÆäËûµÄoutput)
0001,TOM
0002,JOHN ......

·ÖÏí×Ô¼ºµÄOracleÅäÖùý³Ì - Oracle / »ù´¡ºÍ¹ÜÀí

Ð»Ð»ÌÆÈËÀÏ´óµÄÖ¸µã£¬Ð»Ð»¸÷λ¸ßÊÖµÄÖ¸µã£¡
°²×°10g Enterprise¡£ÉÏÍøÏÂÁËMLDNµÄOracleÊÓÆµ£¬¸ú×ÅÊÓÆµÉϵÄÅäÖÃ×ߣ¬°²×°³É¹¦ÁË£¬µ«ÊÇûÍêÕûµØÅäÖá£
µã»÷½øÈ룺Database Configuration Assistant
1. ´´½¨Êý¾Ý¿â£» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ