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

ÓÃSQLÓï¾äÆ´½ÓÊý¾Ý¿â±íÖÐÒ»ÁеÄÊý¾Ý

×î½üÔÚÒ»¸öÏîÄ¿ÖÐÓöµ½ÐèÒªÔÚÊý¾Ý²ã¾ÍÆ´½Ó±íÖÐÒ»ÁÐÊý¾ÝµÄÎÊÌâ¡£
ÀýÈ磬test±íÖÐÓиö×Ö¶Ît,tÁÐÖеÄ4ÐÐÊý¾ÝΪ1,2,3,4 £¬ÒªÆ´½Ó³É1+2+3+4£¬×ÁÄ¥ÁËÒ»Õ󣬱¾À´ÏëÓÃÓα꣬µ«ÊÇЧÂÊ¡£¡£ºóÀ´ÕÒµ½Ò»¶ÎSQL£¬¿ÉÒԺܷ½±ãµØÆ´½Ó¡£
DECLARE @STR VARCHAR(8000) ----¶¨Òå²éѯ×Ö·û´®
SELECT @STR=ISNULL(@STR+'+','')+t from (SELECT DISTINCT t from test)AS Temp ----Æ´½Ó²éѯ×Ö·û´®
SELECT @STR  -----Ö´ÐÐ


Ïà¹ØÎĵµ£º

SQL Server2005 µ¼ÈëÊý¾Ý³ö´í

´íÎóÌáʾ£º
Ö¸¶¨µÄÁ¬½ÓÀàÐÍ“OLEDB”δ±»Ê¶±ðΪÓÐЧµÄÁ¬½Ó¹ÜÀíÆ÷ÀàÐÍ¡£µ±ÊÔͼ´´½¨Î´ÖªÁ¬½ÓÀàÐ͵ÄÁ¬½Ó¹ÜÀíÆ÷ʱ»á·µ»Ø´Ë´íÎó¡£Çë¼ì²éÁ¬½ÓÀàÐÍÃû³ÆµÄƴдÊÇ·ñÕýÈ·¡£
½â¾ö·½·¨£º
sqlserver2005-ÅäÖù¤¾ß-SqlServer configuration manager-SqlServer2005·þÎñ-sqlserver Integration Services£¬ÓÒ»÷-Ñ¡ÔñÊôÐÔ£¬È»ºó° ......

SQL SERVER 2005Ⱥ¼¯


SQL SERVER 2005µÄȺ¼¯±ØÐëÔÚʵÏÖÁËWINDOWSȺ¼¯µÄ»ù´¡ÉϲſÉÒÔ¡£
Ê×ÏÈÎÒÃÇÏÈÀ´¿´Ò»ÏÂSQL SERVER 2005Ⱥ¼¯µÄһЩÏà¹Ø½éÉÜ£º
ÔÚSQL SERVER 2005ÖÐÖ÷Òª¿ÉÒÔʹÓþµÏñºÍȺ¼¯Á½ÖÖ·½·¨À´ÊµÏָ߿ÉÓÃÐÔ£¬ÖÁÓÚÊý¾Ý¿â¾µÏñ×÷ΪSQL SERVER 2005µÄÐÂÌØÐÔÖ®Ò»£¬ÎÒÔÚÇ°ÃæµÄ²©ÎÄÒѾ­×öÁ˽éÉÜ£¬½ñÌìÎÒÃǾÍÀ´¿´Ò»ÏÂȺ¼¯µÄÅäÖ÷½·¨£ºµ±È»Ëüà ......

Interbase/FirebirdµÄSQLÓï·¨(ÊÕ²Ø)


Ò»¡¢·Öҳд·¨Ð¡Àý£º
SELECT FIRST 10 templateid,code,name from template ;
SELECT FIRST 10 SKIP 10 templateid,code,name from template ;
SELECT * from shop ROWS 1 TO 10;   –firebird2.0Ö§³ÖÕâÖÖд·¨
 
¶þ¡¢ÏÔʾ±íÃûºÍ±í½á¹¹
SHOW TABLES;
SHOW TABLE tablename;
ËÄ¡¢¸üÐÂ×Ö¶Î×¢ÊÍ
......

OracleÈçºÎÖ´ÐÐÅúÁ¿sqlÓï¾ä

Òª´´½¨Á½¸öÎļþ
1: runBatch.bat
2: sql.txt
runBatch.bat ÄÚÈÝÈçÏ£º
sqlplus username/password @sql.txt
pause
sql.txtÄÚÈÝÈçÏ£º
spool sql.log
create table t1(cname char(20));
insert into t1(cname) values('test');
select * from t1;
spool off
exit
Ë«»÷runBatch.bat¾Í¿ÉÒÔÅúÁ¿Ö´ÐÐsql.txtÖÐ ......

orale sqlÏà¹Øѧϰ

to_dateºÍto_charÊÇoracleÀïÀïÃæµÄÄÚÖú¯Êý¶ø²»ÊDZê×¼µÄsqlÓï·¨Öеĺ¯Êý£¬Ó÷¨¾ÙÀý£º
1.to_char£¬·µ»Ø½á¹û¿ÉÏÔʾΪ¸÷ÖÖÐÎʽ
 select to_char(sysdate,'yyyy/mm/dd') ,sysdate from dual;
½á¹û£º  2010/05/26               &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ