我有这样一张表:
a b
8 7
8 2
9 7
9 2
9 3
我希望得到一个"a"变量,使其拥有与"b"精确搜索值相同的结果。例如,如果我搜索(7,2),我希望查询返回8;如果我搜索(7,2,3), 我希望它返回9,否则必须返回Null:
Search Result
(7,2) 8
(7,2,3) 9
(7,3) Null
(7,2,4) Null
...
不使用“group by”连接,是否有可能完成此操作?
[编辑] 对于“group by concatenation”,我指的是像MySql中的GROUP_CONCAT()或任何字符串函数。