mysql 语句,要求从表中判断是否有存在匹配的字符串

2025-02-27 23:40:00
推荐回答(1个)
回答1:

if exists(select * from table where port like '%161%')
print 0
else
print 1

这是sql server的写法,不知道在mysql能不能通过,你试一下吧