sqlÌâÖеÄÖÖÖÖ
ÔÚ×ösqlÌâʱ£¬ÎÒÃÇ×îÅÂÓöµ½Ìõ¼þ¸´ÔӵIJéѯÓï¾ä£¬ÒòΪ´ó¶àʱºòÐèÒªÁ½Èý¸ö×Ó²éѯÀ´ÊµÏÖ£¬
¶ø´ó¶àÊýͬѧ£¬¿ÉÒÔ˵¶¼±È½ÏÅÂ×Ó²éѯµÄ£¬ÒÔÇ°ÎÒÒ²±»ÕâЩÌâĿŪµÄÔÆÀïÎíÀïµÄ£¬
²»¹ý×ö¶àÁËÕâÀàµÄÌâÄ¿ºó·¢ÏÖ£¬ÆäʵҲÓÐÒ»¶¨¹æÂÉ£¬ÎÒÃÇ¿ÉÒÔ×ܽáÒ»Ì×ÊʺÏ×Ô¼ºµÄ·½·¨À´´¦Àí£¬
ÏÂÃæʱÎÒ¶Ô¸ÃÀàÌâÄ¿µÄ´¦Àí·½·¨£º
ÓйºÎï±íÈçÏ£º
ÌâÄ¿£º ²éѯ¹ºÎïÉÌÆ·ÀàÐͲ»Ö»Ò»ÖֵĹºÎïÕßµÄÐÅÏ¢¡£
ÎÒ½«ÌâÄ¿²ð·ÖÈçÏ£º
Ôò¿ÉµÃ³öÁ½Ìõ²éѯÓï¾ä£º
<1>select * from ¹ºÎïÐÅÏ¢±í where ¹ºÎïÕß in……
<2>select ¹ºÎïÕß from ¹ºÎïÐÅÏ¢±í group by ¹ºÎïÕß having count(*)>=2
½«Óï¾ä<2>¼Óµ½Óï¾ä<1>ºó¼´¿ÉµÃ³öÒ»ÖÖÕýÈ·´ð°¸¡£
½«Óï¾ä´ÓÍâÏòÀïÆÊÎö£¬Äóö¼òµ¥µÄ²éѯÓï¾ä£¬È»ºóÔÙ×éºÏ¡£
µ±È»ÎÒÕâÀïµÄÌâÄ¿£¬ÊÇÎÒÁÙʱÏëµÄ¿ÉÄÜ»¹±È½Ï¼òµ¥£¬ÎÒÓмû¹ýÕâÑùµÄÓï¾ä
²éѯ……µÄ……µÄ……µÄ……µÄ……¡£¿ÉÒÔ˵¿ÉÄÜÓÐÁ½Èý¸ö»ò¸ü¶àµÄ×Ó²éѯ£¬ÄǾÍÐèÒªÓÐÒ»¸öºÃµÄ·½·¨ÁË¡£
Ïà¹ØÎĵµ£º
pl/sql ÌṩÁËÇ¿´ó¶øÁé»îµÄÊÖ¶ÎÀ´²¶×½ºÍ´¦Àí³ÌÐò²úÉúµÄÒì³££¬´Ó¶øʹ oracle µÄÓû§Ô¶ÀëһЩÁîÈË·³ÄÕµÄ bug ¡£
pl/sql Òì³£´¦ÀíµÄ¸ÅÄîºÍÊõÓï
ÔÚ oracle ÖÐËùÓеĴíÎ󶼱»ÈÏΪÊDz»Ó¦¸Ã·¢ÉúµÄÒì³£¡£Ò»¸öÒì³£¿ÉÄÜÊÇÒÔÏ 3 ÖÖÇé¿öµÄÒ»ÖÖ£º
u ÓÉϵͳ²úÉúµÄ´íÎó£¨& ......
SQL Server 2000 Êý¾Ý¿âͬ²½ÅäÖõÄÔÀí
¸´ÖƵĸÅÄî
Microsoft? SQL Server? 2000 µÄ¸´ÖÆÊÇÔÚÊý¾Ý¿âÖ®¼ä¶ÔÊý¾ÝºÍÊý¾Ý¿â¶ÔÏó½øÐи´ÖÆ
ºÍ·Ö·¢²¢½øÐÐͬ²½ÒÔÈ·±£ÆäÒ»ÖÂÐÔµÄÒ»×é¼¼Êõ¡£
ʹÓø´ÖÆ¿ÉÒÔ½«Êý¾Ý·Ö·¢µ½²»Í¬Î»Öã¬Í¨¹ý¾ÖÓòÍø¡¢Ê¹Óò¦ºÅÁ¬½Ó¡¢Í¨¹ý Internet ·Ö
·¢¸øÔ¶³Ì»òÒƶ¯Óû§¡£¸´ÖÆ»¹Äܹ»Ê¹Óû§Ìá¸ßÓ¦ÓóÌÐòÐÔÄÜ ......
update anketo1 set fb = substring('10',fb+1,1) WHERE id =5
ºóÀ´ÎÊÁËBM,BM˵ֱ½ÓÈ¡·´
update anketo1 set fb = ~ fb WHERE id =5
ÎÒ¸æËßÁËBMÓÃsubstringÒ²¿ÉÒÔ.
BM˵:"Õâ¼Ò»ïÀ÷º¦£¬ÕâÒ²ÄÜÏë³ö,ÕâÊôÓÚаÃÅÎ书."
×îºóÓÖÏëµ½ÓÃABSÈ¡¾ø¶ÔÖµÒ²¿ÉÒÔ
update anketo1 set fb = abs(fb-1)
ÎÒ¾õµÃ²»¹ÜÊÇʲôÎ书,ÄÜÖ ......
ÔÚPostgreSQL8.1.3ÉÏ¿ÉÒÔwork
1. È¡Êý¾Ý¿â´óС
SELECT pg_size_pretty(pg_database_size('somedatabase')) As fulldbsize
2. È¡±í´óС
SELECT pg_size_pretty(pg_total_relation_size('someschema.sometable')) As fulltblsize, pg_size_pretty(pg_relation_size('someschema.sometable')) As justthetblsize
ÔÌù£º
......