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

ÔÚSQL Server ɾ³ýÖØ¸´Êý¾Ý

ɾ³ýÊý¾Ý¿â±íÖÐijһ×ֶεÄÖØ¸´¼Í¼£¬Ö»Ïë±£ÁôÒ»Ìõ¼Ç¼¿ÉÓÃÒÔÏ·½·¨£º
Ö´ÐÐÒÔÏÂÓï¾ä£º
declare @max integer,@id varchar(18) --´Ë´¦±äÁ¿ÀàÐ͸ù¾Ý×Ö¶ÎÀàÐÍÉèÖÃ
declare cur_rows cursor local for select ×Ö¶Î,count(*) from ±íÃûgroup by ×Ö¶Î having count(*) > 1
open cur_rows
fetch cur_rows into @id,@max
while @@fetch_status=0
begin
 select @max = @max -1
 set rowcount @max
 delete from ±íÃûwhere ×Ö¶Î = @id
 fetch cur_rows into @id,@max
end
close cur_rows
set rowcount 0


Ïà¹ØÎĵµ£º

¡¾×ª¡¿ ¡¾SQL¡¿ÐÐÁÐת»»

¡¾SQL¡¿ÐÐÁÐת»»
http://space.itpub.net/519536/viewspace-609167
Ò»¡¢ÁбäÐÐ
1.´´½¨²âÊÔ±ítest£¬²¢³õʼ»¯ÊµÑéÊý¾Ý
sec@ora10g> create table test (name_id varchar2(10), name varchar2(10));
sec@ora10g> insert into test values ('01','Andy1');
sec@ora10g> insert into test values ('01','Andy2'); ......

SQL Server°²×°Ê±COM+Ŀ¼ҪÇóÎÊÌâµÄ½â¾ö·½·¨

ºÜÔç¾Í²»ÓÃSQLServer 2005ÁË£¬½ñÌìͻȻ½Óµ½¸öÏîÄ¿£¬Ëµ·ÇÓÃSQLServer²»¿É£¬Ã»°ì·¨£¬Ö»ºÃ°Ñ¾ÃÎ¥µÄÀÏÅóÓÑ×°ÉÏÈ¥ÁË£¬Óöµ½ÁËCOM+µÄĿ¼ҪÇó²»ÐеÄÎÊÌ⣬ÒÔǰÕâ¸öÎÊÌâÎÒҲûÓÐ×¢Ò⣬½ñÌìÏë½â¾öϸø´ó»ï¿´¿´¡£
¡¡¡¡½â¾öµÄ·½·¨ÆäʵºÜ¼òµ¥£¬ÈçÏ£º
¡¡¡¡1¡¢¿ª»§MSDTC·þÎñ£º“¿ªÊ¼-ÔËÐД£¬ÊäÈë"cmd"ºó»Ø³µ ......

SQLÇó½â°Ë»ÊºóÎÊÌ⣨92ÖÖ½á¹û£©

--¸Ã±í±£´æ½á¹û
create table c(c1 tinyint, c2 tinyint, c3 tinyint, c4 tinyint, c5 tinyint, c6 tinyint, c7 tinyint, c8 tinyint, c9 tinyint, c10 tinyint, c11 tinyint, c12 tinyint, c13 tinyint, c14 tinyint, c15 tinyint, c16 tinyint, c17 tinyint, c18 tinyint, c19 tinyint, c20 tinyint, c21 tinyint, c22 t ......

SQL¾«»ªÊÕ¼¯

order by µÄÊýÖµÐÍÁé»îʹÓÃ
select * from table_a where id=p_id order by decode(º¯Êý,'asc',1,'desc',-1)*jsny;
¿ØÖÆÊÔͼµÄ·ÃÎÊʱ¼ä£º
6.create view ...
as
select ... from where exists(select x from dual where sysdate>=8:00am and sysdate<=5:00pm)
ÃîÓÃdecodeʵÏÖÅÅÐò
select * from tabnam ......

ORACLE SQL ÓÅ»¯

http://kang275284.javaeye.com/blog/154331
Ò»¡¢ ÏȽéÉÜÒ»ÏÂoracle
µÄSGA£ºÊý¾Ý¿âµÄϵͳȫ¾ÖÇø£¬SGAÖ÷ÒªÓÉÈý²¿·Ö¹¹
³É£º¹²Ïí³Ø¡¢Êý¾Ý»º³åÇø¡¢ÈÕÖ¾»º³åÇø¡£
1¡¢ ¹²Ïí³ØÓÖÓÉÁ½²¿·Ö¹¹³É£º¹²ÏíSQL
Çø
ºÍÊý¾Ý×ֵ仺³åÇø¡£¹²ÏíSQL
Çø×¨ÃÅ´æ·ÅÓû§SQL
Ãü
Áoracle
ʹÓÃ×î½ü×îÉÙʹÓõÈÓÅÏȼ¶Ëã·¨À´¸üи²¸Ç£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ