1.like
select device_id,age,university
from user_profile
where university like '%北京%';
注意虽然按实际需求,北京一般是排在最前面,即北京%,但是严格意义上来说,搜索含有北京的字符,应该用%北京%
2.正则表达式
select device_id,age,university
from user_profile
where university regexp '北京';
1.like
select device_id,age,university
from user_profile
where university like '%北京%';
注意虽然按实际需求,北京一般是排在最前面,即北京%,但是严格意义上来说,搜索含有北京的字符,应该用%北京%
2.正则表达式
select device_id,age,university
from user_profile
where university regexp '北京';