如何让记录我有一个表像下面:在以下情况下
node_name id term_name
----------------------------------------------
test1 001 physics
test1 001 maths
test1 001 chemistry
test2 002 physics
test2 002 maths
鉴于我想找到其中id
只设置恰好包含给定项名称的所有行项名称的组合。
例如,给定项名称物理&数学我的输出应该像下面
node_name id term_name
----------------------------------------------
test2 002 physics
test2 002 maths
标识设置001
还包含chemistry
这就是为什么它不应该被包括在内。
你能解释一下为什么你的结果不会在你的例子中包括'test1 001 physics'和'test1 001 maths'?它们都与其他两行匹配的“物理”和“数学”相匹配。有什么不同? – ChrisWue 2011-12-22 07:00:37
@ChrisWue,因为'id 001'也包含'chemistry' – rabudde 2011-12-22 07:03:53