ÇóÒ»ÌõsqlÓï¾ä ±íÄÚ×Ö¶Î id stn 1 10-11-55-23 2 10-22-33-44 3 4-66-44-22-10
select * from stn where stn like '%10%44%' ÏëµÃµ½2£¬3 ¾ÍÊÇÄǸöÆ¥ÅäÎÊÌ⣬ ¿ÉÄÜ´æÔÚ'%10%44%'Ò²¿ÉÄÜ´æÔÚ'%44%10%' Èç¹ûÊäÈë '%10%44%' Ö»ÄÜËÑË÷µ½2 Èç¹û'%44%10%' Ö»ÄÜËÑË÷µ½3 Ïë2£¬3¶¼µÃµ½Ôõô°ìÄØ£¿ ллselect * from stn where stn like '10%' SQL code: select * from stn where stn like '%10%' and stn like '%44%'
¿´´íÁË select * from stn where stn like '%44%' ͬÒâ SQL code: create table tb(id int,stn varchar(50)) insert into tb values(1, '10-11-55-23') insert into tb values(2, '10-22-33-44') insert into tb values(3, '4-66-44-22-10') go
select * from tb where stn like '%10%' and stn like '%44%'
drop table tb
/* id stn ----------- -------------------------------------------------- 2 10-22-33-44 3 4-66-44-22-10