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

ÇóSQLÒ»ÌõÓï¾äµÄ½â¾ö·½·¨

±ÈÈç ÎÒÓÐÒ»¸ö±í bumen

ÀïÃæ ÓÐÒ»¸öÁР quanxian
id  name  quanxian

1    a    001;002;003;
2    b    002;003;
3    c    003;004;
4    d    001;002;003;

ÎÒµÄÒâ˼ÊǰÑquanxianÁÐÖк¬ÓÐ002µÄÊý¾ÝÈ¡³öÀ´£»ÏÔʾÔÚgridviewÉÏ£¿
Çë´óÏÀÃǰïæ£¡ 
select * from tumen where quanxian like '%002%'

select * from tumen where quanxian like '%002%'
select * from tumen where charindex('002',quanxian) > 0

SQL code:

if object_id('ta') is not null drop table ta
go
create table ta(id int, name varchar(1), quanxian varchar(20))
insert into ta select
1, 'a', '001;002;003;' union all select
2, 'b', '002;003;' union all select
3, 'c', '003;004;' union all select
4, 'd', '001;002;003;'

select * from ta
where charindex(';002;',';'+quanxian)>0

id name quanxian
----------- ---- --------------------
1 a 001;002;003;
2 b 002;003;
4 d 001;002;003;

(3 ÐÐÊÜÓ°Ïì)



SQL code:
select * from tumen where charindex(','+'002'+',',','+quanxian+',') >


Ïà¹ØÎÊ´ð£º

sql ʱ¼äÎÊÌâ

sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001

ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......

ÇóSQL¡«¡«¡«¡«¡«

×ÜÊý±í
×Ö¶Î num,freq
numÊÇËùÊôÆÚµÄ×ÜÊý£¬freqÊǼǼ¸ÃÊýÖµËùÊôÄÄÒ»ÆÚµÄ


ÇøÓò±í
×Ö¶Î area_name,tot,freq
ÇøÓòÃû³Æ£¬¸ÃÇøÓòµÄ×ÜÊý£¬ËùÊôÆÚ

Á½ÕÅ±í¿¿freq¹ØÁª£¬ÇÒ²»ÊÇ×ÔÔö×ֶΣ¬²»ÊÇÖ ......

sql server 2000 µÇ¼ʧ°Ü

µã»÷¡°·þÎñ¹ÜÀíÆ÷¡±£¬µã»÷¡°¿ªÊ¼/¼ÌÐø¡±£¬×ÜÊÇÏÔʾ¡°ÓÉÓڵǼʧ°Ü¶øÆô¶¯·þÎñ¡±£¬È»ºóÔٴγö´í£¬²»Äܹ»½øÈ룬Ҳ²»Äܹ»²é¿´ÊôÐÔ£¬ÇëÎÊ´ó¼Ò¸ÃÔõô°ì£¿

ÎÒÊDzſªÊ¼Ñ§Ï°Êý¾Ý¿â£¬ÇëÎÊ´ó¼ÒÓÐûÓÐʲôºÃһЩµÄ½¨Òé»òÕ ......

sql ²éѯ-¸üР×èÈû¡£¡£¡£¡££¿

Óöµ½µÄÏÖÏóÊÇ Í¬Ò»¸ö±íµÄquery»á×èÈûupdate

sql  query ºÍupdate ²Ù×÷ query»á×èÈûupdate²Ù×÷Âð

Ôõô½â¾ö

ÊDz»ÊÇʲôÉèÖò»¶Ô»¹ÊÇÔõµÄ


Èç¹û»áµÄ»°£¬ÄÇͬһ¸ö±íµÄƵ·±query and ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ