Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 2 列
Config Plant ------ ----- ROC DEP1 RET DEP1 ROC UAP1 RET UAP1 SSL UAP1 ROC PLP2 RET PLP2
如何获取config所有plants 相同的记录。
config
plant
在这个例子中,结果应该是
ROC RET
SELECT Config FROM theTable GROUP BY Config HAVING COUNT(*) = (SELECT COUNT(DISTINCT(Plant)) FROM theTable)
SQL小提琴