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

sqlÈ¡²éѯֵ

ÈçÌ⣺select name from table1
µÃµ½½á¹û£ºname
          СÍõ
          СÕÔ
          СÀî
          СÖÜ
ÏëÒª½á¹û£º
°Ñ²éѯµ½µÄ½á¹û¸³Öµ¸ø@SQL
Ô­Ö°£º@sql='admin'
ÏëÒª½á¹û£º@sql=@sql+',СÍõ£¬Ð¡ÕÔ£¬Ð¡ÀСÖÜ'
×¢£º¾¡Á¿²»Òªdo..whileÑ­»·
ÔÚÏߵȣ¬Ó⻶®µØ·½Çë˵£¡


¶¥¶¥

declare @sql varchar(500)
select @sql='admin'
select @sql=@sql+','+name from table1
print @sql
ÎÊÌâ»ù±¾½â¾ö£¬¿ÉÊÇ [tabel]±íÊDZäÁ¿£¬²»È·¶¨
¸ÃÈçºÎ

ÒýÓÃ
declare @sql varchar(500)
select @sql='admin'
select @sql=@sql+','+name from table1
print @sql
ÎÊÌâ»ù±¾½â¾ö£¬¿ÉÊÇ [tabel]±íÊDZäÁ¿£¬²»È·¶¨
¸ÃÈçºÎ


SQL code:
declare @table1 nvarchar(50)
set @table1 = '****'
...
exec 'select @sql = @sql + '',''+ name from @table1'
...


ѧϰ

ÒýÓÃ
declare @sql varchar(500)
select @sql='admin'
select @sql=@sql+','+name from table1
print @sql
ÎÊÌâ»ù±¾½â¾ö£¬¿ÉÊÇ [tabel]±íÊDZäÁ¿£¬²»È·¶¨
¸ÃÈçºÎ

ÄǾÍÏñÎÒÃÇÒ»°ãº¯ÊýÑùµÄ


Ïà¹ØÎÊ´ð£º

sql ʱ¼äÎÊÌâ

sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001

ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......

Á½¸öµ¼¹¹sql serverÊý¾Ý¿â,Êý¾Ýµ¼Èëµ¼³öÎÊÌâ

ÏÖÔÚÓÐÁ½¸öÒì¹¹µÄsql serverÊý¾Ý¿â,ÎÒÏ뽫µÚÒ»¸ö±íÖеÄÊý¾Ýµ¼Èëµ½µÚ¶þ¸ö±íÖÐ,×Ô¼ºÖ¸¶¨µ¼ÈëÊý¾ÝµÄ×Ö¶Î,ÈçºÎµ¼ÈëÊý¾ÝÄØ,´ó¼ÒÌÖÂÛÒ»ÏÂ?
dts¹¤¾ß

µ¼Èëµ¼³ö¹¤¾ß.

DD

¹þ¹þ£¬¹À¼ÆÕâλÊǵØQIOU¶¼Êܲ»Á˵Ä

Ö±½ÓÐ ......

sql server ´æ´¢¹ý³ÌÑ­»·¸³ÖµµÄÎÊÌâ

СµÜÊǸöÐÂÊÖ ÏÖÔÚÓиöÎÊÌâÒ»Ö±²»Äܽâ¾ö
ÀýÈç
procedure produce_proc
    @p001 nvarchar(8000),
    @p002 nvarchar(8000),
    @p003 nvarchar(8000),
  & ......

ÇóÒ»sqlÓï¾ä¡£

±íÖÐÊÇÕâÑù£¬
²¿ÃźŠ   ²¿ÃÅÐÅÏ¢
  1        ²¿ÃÅÒ»
  2        ²¿ÃŶþ
  3        ²¿ÃÅÈý
  4& ......

access Êý¾Ý¿â SQLÓï¾äÔõôÑùËæ»úÑ¡ÔñÊý¾Ý£¿£¿

³ÌÐòʱASP+access

sql="select top 2 id,username from comp    order by rnd(id)  "

ÉÏÃæÓï¾äˢкó¶¼ÊÇÒ»¸öÖµ ÕâÑù»¹ÓÐËæ»úµÄÒâÒåÂð

ACCESSÓÐË¢ÐÂËæ»úÑ¡ÔñµÄSQLÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ