sqlÌâÖеÄÖÖÖÖ
ÔÚ×ösqlÌâʱ£¬ÎÒÃÇ×îÅÂÓöµ½Ìõ¼þ¸´ÔӵIJéѯÓï¾ä£¬ÒòΪ´ó¶àʱºòÐèÒªÁ½Èý¸ö×Ó²éѯÀ´ÊµÏÖ£¬
¶ø´ó¶àÊýͬѧ£¬¿ÉÒÔ˵¶¼±È½ÏÅÂ×Ó²éѯµÄ£¬ÒÔǰÎÒÒ²±»ÕâЩÌâĿŪµÄÔÆÀïÎíÀïµÄ£¬
²»¹ý×ö¶àÁËÕâÀàµÄÌâÄ¿ºó·¢ÏÖ£¬ÆäʵҲÓÐÒ»¶¨¹æÂÉ£¬ÎÒÃÇ¿ÉÒÔ×ܽáÒ»Ì×ÊʺÏ×Ô¼ºµÄ·½·¨À´´¦Àí£¬
ÏÂÃæÊ±ÎÒ¶Ô¸ÃÀàÌâÄ¿µÄ´¦Àí·½·¨£º
ÓйºÎï±íÈçÏ£º
ÌâÄ¿£º ²éѯ¹ºÎïÉÌÆ·ÀàÐͲ»Ö»Ò»ÖֵĹºÎïÕßµÄÐÅÏ¢¡£
ÎÒ½«ÌâÄ¿²ð·ÖÈçÏ£º
Ôò¿ÉµÃ³öÁ½Ìõ²éѯÓï¾ä£º
<1>select * from ¹ºÎïÐÅÏ¢±í where ¹ºÎïÕß in……
<2>select ¹ºÎïÕß from ¹ºÎïÐÅÏ¢±í group by ¹ºÎïÕß having count(*)>=2
½«Óï¾ä<2>¼Óµ½Óï¾ä<1>ºó¼´¿ÉµÃ³öÒ»ÖÖÕýÈ·´ð°¸¡£
½«Óï¾ä´ÓÍâÏòÀïÆÊÎö£¬Äóö¼òµ¥µÄ²éѯÓï¾ä£¬È»ºóÔÙ×éºÏ¡£
µ±È»ÎÒÕâÀïµÄÌâÄ¿£¬ÊÇÎÒÁÙʱÏëµÄ¿ÉÄÜ»¹±È½Ï¼òµ¥£¬ÎÒÓмû¹ýÕâÑùµÄÓï¾ä
²éѯ……µÄ……µÄ……µÄ……µÄ……¡£¿ÉÒÔ˵¿ÉÄÜÓÐÁ½Èý¸ö»ò¸ü¶àµÄ×Ó²éѯ£¬ÄǾÍÐèÒªÓÐÒ»¸öºÃµÄ·½·¨ÁË¡£
Ïà¹ØÎĵµ£º
ÓÃASPʵÏÖSQL SERVERÊý¾Ý¿âµÄÔ¶³Ì¸üÐÂ
½ËÕʡͨÖÝÖ°Òµ¸ß¼¶ÖÐѧ Áõ¼Æºâ
΢ÈíµÄSQL Server ÊÇÒ»¸ö´óÐ͵ĹØÏµÊý¾Ý¿âϵͳ£¬ËüΪÔÚ¸´ÔÓ»·¾³ÏÂÓÐЧµØÊµÏÖÖØÒªÉÌÒµÓ¦ÓÃÌṩÁËÒ»¸öÇ¿ÓÐÁ¦µÄ¿Í»§/·þÎñÆ÷ƽ̨¡£Ëü½áºÏMicrosoft Windows NT²Ù×÷ϵͳµÄÄÜÁ¦£¬ÌṩÁËÒ»¸ö°²È«¡¢¿ÉÀ©Õ¹¡¢Ò×¹ÜÀí¡¢¸ß¶ËÐÔÄܵĿͻ§/·þÎñÆ÷Êý¾Ý¿âƽ̨¡£Õ ......
General Overview
FeatureSQL Server 2008 (RC0)MySQL 5.1/6PostgreSQL 8.3/PostGIS 1.3/1.4
OS
Windows XP, Windows Vista, Windows 2003, Windows 2008
Windows XP, Windows Vista, (haven't tested on 2008), Linux, Unix, Mac
Windows 2000+ (including Vista and 2003, haven't tested on 2008), Linux, Unix, Ma ......
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)
ÎÒ¾õµÃ²»¹ÜÊÇʲôÎ书,ÄÜÖ ......