一個函數: FIND_IN_SET(str,listStr) 意思是:如果字符串str 在字符串列表listStr中, 則返回值的範圍在 1 到 N 之間的數 總之,只要返回的值大於0就代表有在裏面 用法:
select u.user_name from user u where FIND_IN_SET(u.id,#{listStr})
一個函數: FIND_IN_SET(str,listStr) 意思是:如果字符串str 在字符串列表listStr中, 則返回值的範圍在 1 到 N 之間的數 總之,只要返回的值大於0就代表有在裏面 用法:
select u.user_name from user u where FIND_IN_SET(u.id,#{listStr})