ÎÒÏëÓÃÒ»ÌõSQLÏÔʾÕâÑùµÄ½á¹û
²»ÖªµÀÕâÑùµÄÒªÇóÄܲ»ÄÜʵÏÖ£¿
±ÈÈçÎÒÓÐÒ»ÕűíT1£¬ÀïÃæÖ»ÓÐÒ»¸ö×Ö¶Î1
ÀïÃæÓÐ100Ìõ¼Ç¼£¬ÈçÏÂËùʾ£º
×Ö¶Î1
A1
A2
A3
A4
...
A100
ÎÒÏëÓÃÒ»ÌõSQLÏÔʾÕâÑùµÄ½á¹û
µÚÒ»ÁÐ µÚ¶þÁÐ ... µÚÊ®ÁÐ
A1 A11 A91
A2 A12 A92
A3 A13 A93
... ... ...
A10 A20 A100
²»Öª¿É·ñʵÏÖ£¿µ±È»£¬Ò²²»Ò»¶¨·Ö³ÉÊ®ÁУ¬¿ÉÄÜÊÇÎåÁеȵȣ¬Çë¸ßÊִͽ̡£Ð»Ð»
--¼ÙÉè×ֶβ»´æÔÚÏàֵͬ.
select
max(case (px - 1) % 10 when 0 then ×Ö¶Î1 else '' end) [c1],
max(case (px - 1) % 10 when 1 then ×Ö¶Î1 else '' end) [c2],
max(case (px - 1) % 10 when 2 then ×Ö¶Î1 else '' end) [c3],
max(case (px - 1) % 10 when 3 then ×Ö¶Î1 else '' end) [c4],
max(case (px - 1) % 10 when 4 then ×Ö¶Î1 else '' end) [c5],
max(case (px - 1) % 10 when 5 then ×Ö¶Î1 else '' end) [c6],
max(case (px - 1) % 10 when 6 then ×Ö¶Î1 else '' end) [c7],
max(case (px - 1) % 10 when 7 then ×Ö¶Î1 else '' end) [c8],
max(case (px - 1) % 10 when 8 then ×Ö¶Î1 else '' end) [c9],
max(case (px - 1) % 10 when 9 then ×Ö¶Î1 else '' end) [c10]
from
(
select * , px = (select count(1) from t1 where ×Ö¶Î1 < t.×Ö¶Î1) + 1 from t1 t
) m
group by (px - 1) / 10
--Èç¹û×ֶδæÔÚÏàֵͬ.
--sql 2000ÐèҪʹÓÃÁÙʱ±í
select * , px = identity(int,1,1) into tmp from t1
select
max(case (px - 1) % 10 when 0 then ×Ö¶Î1 else '' end) [c1],
max(case (px - 1) % 10 when 1 then ×Ö¶Î1 else '' end) [c2],
max(case (px - 1) % 10 when 2 then ×Ö¶Î1 else '' end) [c3],
m
Ïà¹ØÎĵµ£º
OracleÖг£ÓõÄÃüÁîºÍº¯Êý£¬×ö¸öÕûÀí£¬ÒÔ±¸ÒÔºóÓõ½£¬·½±ã²éÔÄ¡£
³£ÓÃÃüÁ
Á¬½Ósqlplus
ÃüÁîÐÐÏÂÔËÐÐcmd½øÈ룬ÈçÒÔsysģʽµÇ½£¬ÃüÁîÈçÏ£º
(1).sqlplus "sys/zhb126 as sysdba"
(2).sqlplus/nolog connect sys/zhb126 as sysdba
(3).sqlplus scott ......
1. ¶ÔÓÚPHP magic_quotes_gpc=onµÄÇé¿ö£¬ ÎÒÃÇ¿ÉÒÔ²»¶ÔÊäÈëºÍÊä³öÊý¾Ý¿âµÄ×Ö·û´®Êý¾Ý×÷
addslashes()ºÍstripslashes()µÄ²Ù×÷,Êý¾ÝÒ²»áÕý³£ÏÔʾ¡£ Èç¹û´ËʱÄã¶ÔÊäÈëµÄÊý¾Ý×÷ÁËaddslashes()´¦Àí£¬
ÄÇôÔÚÊä³öµÄʱºò¾Í±ØÐëʹÓÃstripslashes()È¥µô¶àÓàµÄ·´Ð±¸Ü¡£ 2. ¶ÔÓÚPHP magic_quotes_gpc=off µÄÇé¿ö ±ØÐëÊ¹Ó ......
Çå¿ÕÈÕÖ¾£º
dump transaction ¿âÃû with no_log
½Ø¶ÏÈÕÖ¾£º
backup log ¿âÃû with no_log
ѹËõÊý¾Ý¿â£º
dbcc shrinkdatabase (¿âÃû, Ä¿±ê±ÈÂÊ)
ѹËõÊý¾Ý¿âÎļþ£º
dbcc shrinkfile (ÎļþÃû»òID, Ä¿±ê´óС)
ÎļþÃû»òID¿ÉÒÔͨ¹ýϵͳ±ísysfiles²éÕÒ£¬Èç¹û²»Ö¸¶¨Ä¿±ê´óСSQL Server½«×î´óÏ޶ȵÄѹËõÊý¾Ý¿âÎļþ¡£
²é¿´Ñ¹ ......
£¨1£©Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò£¨Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ£©
oracleµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒÖÁ×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í£¨»ù´¡±í£©½«×îÏȱ»´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏÂ,Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í¡£Èç¹ûÓÐ3¸öÒÔÉϵıíÁ¬½Ó²éѯ, ÄǾÍÐèҪѡÔñ½»²æ±í(intersection table)×÷Ϊ»ù´ ......
ÐÐÁÐתÖõÄSQLÓï¾ä
ÁíÒ»ÖÖÐÐÁÐתÖà -- ¶¯Ì¬ sql ½»²æ±í
===========================================================
×÷Õß: wxy0327(http://wxy0327.itpub.net)
·¢±íÓÚ: 2006.05.10 09:11
·ÖÀà:
Oracle
³ö´¦: http://wxy0327.itpub.net/post/16888/88075
-------------------------- ......