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

sqlserverºÍmysqlµÄÐÐתÁÐͨÓô洢¹ý³Ì

sqlserverÖУº
  1 /*
  2 1 * Description:¶ÔÊý¾Ý±í½øÐÐÐÐÁÐת»»
  3 2 * Author:llf
  4 3 * µ÷ÓÃ˵Ã÷£ºexec SP_RowChangeCol 'ѧÉú³É¼¨±í','ÐÕÃû','¿Î³Ì','·ÖÊý','desc',0,0,'where Äê¼¶=''Ò»Äê¼¶'''
  5 4 * ¸Ã´æ´¢¹ý³Ìµ÷ÓõÄÏà¹Øº¯Êý£ºdbo.Get_StrArrayLength(@groupCol,',')£»dbo.dbo.Get_StrArrayStrOfIndex(@groupCol,',',1)
  6 */
  7  
  8 Alter proc SP_RowChangeCol
  9  @tableName varchar(100),    --Ҫת»»µÄÊý¾Ý±íÃû(ѧÉú³É¼¨±í)
 10  @groupCol varchar(100),     --·Ö×éÁÐ(ѧÉúÐÕÃû)
 11  @changeCol varchar(100),    --Ҫת»»µÄÁÐ(¿¼ÊÔ¿ÆÄ¿)
 12  @countCol varchar(100),     --ͳ¼ÆÁÐ(³É¼¨)
 13  @orderby varchar(4),        --ת»»ÁеÄÅÅÐò¹æÔò(ÉýÐòasc,½µÐòdesc)
 14  @isColSum int,              --ÊÇ·ñͳ¼ÆÁУ¨1ÊÇ£»0·ñ£©
 15  @isRowSum int,              --ÊÇ·ñͳ¼ÆÐУ¨1ÊÇ£»0·ñ£©
 16  @strWhere varchar(max)         --²éѯÌõ¼þ('where Äê¼¶=''Ò»Äê¼¶''')
 17  as
 18  begin
 19      declare @sqlhead varchar(8000),@sqlend varchar(8000)
 20       ,@sql1 varchar(8000),@sql2 varchar(8000),@sql3 varchar(8000),@sql4 varchar(8000)
 21       ,@i int,@ic varchar(20),@sql varchar(1000)
 22 
 23 
 24  


Ïà¹ØÎĵµ£º

mysqlÊý¾Ý¿âÉè¼Æ

ÒýÑÔ
¡¡¡¡Êý¾Ý¿âµÄÉè¼Æ·¶Ê½ÊÇÊý¾Ý¿âÉè¼ÆËùÐèÒªÂú×ãµÄ¹æ·¶£¬Âú×ãÕâЩ¹æ·¶µÄÊý¾Ý¿âÊǼò½àµÄ¡¢½á¹¹Ã÷ÎúµÄ£¬Í¬Ê±£¬²»»á·¢Éú²åÈ루insert£©¡¢É¾³ý£¨delete£©ºÍ¸üУ¨update£©²Ù×÷Òì³£¡£·´Ö®ÔòÊÇÂÒÆß°ËÔ㣬²»½ö¸øÊý¾Ý¿âµÄ±à³ÌÈËÔ±ÖÆÔìÂé·³£¬¶øÇÒÃæÄ¿¿ÉÔ÷£¬¿ÉÄÜ´æ´¢ÁË´óÁ¿²»ÐèÒªµÄÈßÓàÐÅÏ¢¡£
¡¡¡¡Éè¼Æ·¶Ê½ÊDz»ÊǺÜÄѶ®ÄØ£¿·ÇÒ² ......

mysql °²×°

½ñÌì°²×°mysqlÓöµ½ºÜ¶àÂé·³£¬ÏëÏóÔ­Òò£¬×Ô¼º»¹ÊÇlinuxµÄ³õѧÕߣ¬Í¬Ê±ÊÜ´ìʱ×ÜÊÇÒª°ÑÎÊÌâµÄ¸´ÔÓϵÊý·Å´ó¡£
1 °²×°³åÍ»
¸ù¾Ý¡¶linux³ÌÐòÉè¼Æ¡·ÉϵÄÖ¸µ¼£¬´Ó¹ÙÍøÏÂÔØÁËmysql-server-xx£¬mysql-devel-xx£¬mysql-client-xx£¬mysql-share-xx£¬È»ºóÖ´ÐÐ
rpm -i *.rpm
½á¹û¶þÊ®¼¸ÐÐconflictÌáʾ£¬ËµÓÐÎļþÓëmysql-server-xxµÄ°² ......

¶ÔmysqlµÄorder by¼°limitÓÅ»¯ÒªÊÊÊý¾ÝÇé¿ö¶ø¶¨

ÒÔÏÂÕâÆªÎÄÕÂÂÛÊöÉÏÔÚʲôÇé¿öÏÂ×Ó²éѯ±ÈÒ»°ãµÄÄÚÁ¬½Ó²éѯ¸ü¼Ó¿ìËÙ
http://www.mysqlperformanceblog.com/2010/03/18/when-the-subselect-runs-faster/
ÒÔÏÂÊÇÎÒ¶ÔmysqlµÄorder byºÍlimitÓÅ»¯µÄ½¨Ò飬ҪÊʱíµÄÊý¾ÝÁ¿ºÍÓÃÀ´¹ýÂËÁеÄΨһֵµÄ¸öÊý¶ø¶¨
£¨1£©where×Ó¾äÖÐÓÃÀ´¹ýÂ˽á¹ûµÄÁÐËùÔÚË÷ÒýµÄcadinalityºÜС£¬¼´ÓÃÏà¹Ø ......

windows7ϰ²×°apache+php+mysqlÎÊÌâ¼Ç¼

×î½üÐÂÂòÁ˸öµçÄÔ£¬ÏµÍ³ÊÇwindows7£¬window7ÔÚ½çÃæ£¬¹¦ÄÜ·½Ã涼ͦÈÃÈËÂúÒâµÄ£¬¸Ð¾õºÜˬ£¬²»Ë¬µÄÊÇÓÖÒªÖØÐ°²×°»·¾³ÁË¡£
ËùÓÐÈí¼þ¾ù°²×°ÔÚF:\server\ÏÂ
apacheĿ¼£ºF:\server\apache2.2
phpĿ¼£ºF:\server\php
msyqlĿ¼£ºF:\server\mysql
Ò»¡¢°²×°apache
°²×°apacheµÄ°æ±¾ÊÇ£ºhttpd-2.2.15-win32-x86-no_ssl.msi
° ......

½â¾ömysql¿Í»§¶ËÂÒÂë

ͨ³£ÎÒϰ¹ß½«mysqlÊý¾Ý¿âÉèÖÃĬÈϱàÂëΪutf-8£¬Õâ¾ÍÓÐÒ»¸öÎÊÌ⣬ÔÚwindows¿Í»§¶ËÖÐÖÐÎÄÏÔʾÂÒÂ룬ÒòΪwindowsĬÈϱàÂëΪgb2312»òansi¡£¶à·½²éÕÒÖÕÓÚ½â¾ö£¬ÔÚwindows¿Í»§¶ËµÇÈëmysql
ÊäÈë
set NAMES GB2312;
СÃüÁ´ó×÷Óð¡¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ