if exists(select * from table where port like '%161%')print 0else print 1这是sql server的写法,不知道在mysql能不能通过,你试一下吧