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

SQLÓï¾äÎÊÌ⣬¸ßÊÖ°ï棡£¡

½«Ò»¸ö±í21~30ɾ³ý£¬sqlÓï¾äÔõôд
Õâ¸öÌ«ÁýͳÁË£¬ÊÇÅÅÐòºóµÄµÚ21Ìõµ½30Ìõ¼Ç¼ɾ³ý»¹ÊÇijһÁÐÖµÔÚ21µ½30Ö®¼äµÄɾ³ý°¡£¿

21-30ÊÇʲôÒâ˼£¿×ֶεĻ°¾Ídelete from table1 where col1>=21 and col1<=30
Ö¸µÄÊǵڼ¸Ìõ¼Ç¼µÄ»°
delete from table1 where rowid in 
  (select rd from (
  select rowid rd,rownum rn from table1)
  where rn>=21 and rn<=30)

ѧϰ¡£¡£¡£



delete from table1 where rn in 
  (
  select rn 
  from 
  ( 
  select row_number() over(partition by ??(ÄãÒªÅÅÐòµÄ×Ö¶Î) rn order by rowid 
  from table1
  ) 
  where rn>=21 and rn <=30
  )

up


Ïà¹ØÎÊ´ð£º

ÇóSQL£¿

´ó¼ÒºÃ£¬ÇëÎÊÔÚ±íMÖÐÓÐ×ֶΣºa b c d e 
ÎÒÏë²é³öÆäÖÐÂú×ãÏÂÃæÈÎÒâÒ»ÏîµÄÊý¾Ý£¬1.×Ö¶Îa µÄÖµ²»ÊÇ ¡®Êé»ò±Ê»ò±¾¡¯ÖÐÈÎÒ»£¬2.aΪÊéµÄʱºò×Ö¶Îb,cÊÇ¿Õ;3.µ±aֵΪ±ÊµÄʱºòdÊÇ¿Õ;4.µ±aΪ±¾µÄʱºòb,d,e¶¼ÊÇ¿Õ;5.È ......

SQL ¹ØÓÚ¶àÌõupdate

ÀýÈçÓÐ2¸ö±í Ò»¸öÊÇÔ±¹¤ÐÅÏ¢±í ±íÀïÓÐÃû×Ö ¹¤×ʵÈ×ֶΠһ¸öÊǹ«Ë¾²ÆÎñ±íÓРÿÔÂ×ÜÖ§³öµÈ×Ö¶Î

ÏÖÔÚÒª¸øÒ»¸öÔ±¹¤Õǹ¤×Ê 500RMB  ¾ÍҪд2Ìõ UPDATEÓï¾ä£¨¼ÙÉèÖ»ÓÐÁ½ÕÅ±í¡£Êµ¼Ê¿Ï¶¨Òª¸ü¶à£©

ÎÊ£ºÈçºÎ ......

ÇóÖú£ºSQLÓï¾ä

±í1£º
col1              col2
a                a.1
b                b.1
......

SQLÌæ»»×Ö·û´®µÄÎÊÌâ

¸÷λ´óÏÀ£¬ÓиöÎÊÌâÇë½Ì£¬ÎÒÏÖÔÚÓÐÁ½ÕűíA,B×ֶζ¼ÓÐnum£¬Èç
A                    B
num                  ......

ÇóÒ»ÌõSQLÓï¾ä¡£

ID  ²Í±ð    ʱ¼ä
1  ÖÐ²Í 2009-10-25
2  ÖÐ²Í 2009-10-26
3  Íí²Í 2009-10-26
4  Ôç²Í 2009-10-27

½á¹û
1  ÖÐ²Í 2009-10-25
3  Íí²Í ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ