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

sqlÁ½Áкϲ¢ÏÔʾ£¿

²éѯ½á¹û¼¯£º
ps  online  totle
a    0      10
b    1      11
c    5        8
ÏëÏÔʾ³ÉÕâÑù
ps      exp
a    (0)|(10)
b    (1)|(11)
c    (5)|(8)

ÈçºÎдsql
SQL code:
select
ps,
'('ltrim(online)+')|('+ltrim(totle)+')' as exp
from
tb


SQL code:
select ps , exp = '(' + cast(online as varchar) + ')|(' + cast(total as varchar) + ')' from tb


SQL code:
select ps,exp='('+cast(online as varchar(10))+')|('+cast(totle as varchar(10))+')' from ±í


SQL code:

--> ²âÊÔÊý¾Ý£º@tb
declare @tb table([ps] varchar(1),[online] int,[totle] int)
insert @tb
select 'a',0,10 union all
select 'b',1,11 union all
select 'c',5,8




select ps,exp='('+ltrim(online)+')'+'('+ltrim([totle])+')' from @tb

/*
ps exp
---- ----------------------------
a (0)(10)
b (1)(1


Ïà¹ØÎÊ´ð£º

Çë½Ìoracleµ¼³öµ½sql server2005

û¸É¹ýÕâÊ£¬Ò²²»ÖªµÀoracleÊý¾Ý¿âɶÑù£¬Çë½Ì´óϺÃǾßÌå²½ÖèÊÇʲô£¿ÐèҪעÒâЩʲô£¿


ORACLEÊý¾Ý¿âÀï±íµ¼ÈëSQL ServerÊý¾Ý¿â
   
  1¡¢ÔÚÄ¿µÄSQL ServerÊý¾Ý¿â·þÎñÆ÷Éϰ²×°ORAC ......

Çë½Ìsql¸ßÊÖ,¹ØÓÚms-sqlserverËø»úÖÆ

SQL code:

declare @cnt int
select @cnt=count(1) from TableTest
if(@cnt==0)
insert into TableTest values(1,'abc')


¶ÔÓÚÕâÑùµÄÒ»¶Îsql²¢·¢Ö´ÐÐʱ,Ó¦¸ÃÓпÉÄܲåÈëÖØ¸´¼Ç¼
²»ÖªµÀ´ó¼ÒÊÇÔõô· ......

¼òµ¥µÄsqlÎÊÌâ

ÐÕÃû  ѧ¿Æ
a      ÓïÎÄ
a      Êýѧ
b      Ó¢Óï
b      ÕþÖÎ

ÎÒÏëµÃµ½  a    ÓïÎÄ£¬Êýѧ
  ......

sql ²éѯ-¸üР×èÈû¡£¡£¡£¡££¿

Óöµ½µÄÏÖÏóÊÇ Í¬Ò»¸ö±íµÄquery»á×èÈûupdate

sql  query ºÍupdate ²Ù×÷ query»á×èÈûupdate²Ù×÷Âð

Ôõô½â¾ö

ÊDz»ÊÇʲôÉèÖò»¶Ô»¹ÊÇÔõµÄ


Èç¹û»áµÄ»°£¬ÄÇͬһ¸ö±íµÄƵ·±query and ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ