table: "table_name" A B "a" 1 "a" 2 "a" 4 "b" 1 "b" 4 "c" 1 "c" 3 のようなデータが 100k レコードほど存在するデータベースにおいて、指定のB (b_list) が存在するA を ランダムに一つ抽出 する。 例: blist: [1] -> mathced A: ["a", "b", "c"] -> ランダムに取り出し -> "b" blist: [1, 2] -> mathced A: ["a"] -> ランダムに取り出し -> "a" blist: [1, 4] -> matched A: ["a", "b"] -> ランダムに取り出し -> "b" このとき、 select A from table_name where B in ({ b_list }) group by A having count(distin