我letters
在 mysql 数据库的列中有以下数据。我把它们保存在varchar
:
letters
["a","b"]
["a","b","d"]
["a","d"]
["d","c","e"]
["e","c","f"]
["c","f"]
["f","e"]
我正在尝试匹配一些元素。当我有params[:lttrs]
as"a"
时,我想返回:
["a","b"]
["a","b","d"]
["a","d"]
当我有params[:lttrs]
as"c,e"
时,我想返回:
["d","c","e"]
["e","c","f"]
我的尝试是检索所有行,然后将它们中的每一行与 匹配include?('a')
,但是这样,我一次只能做一个元素。那是方法吗?