首页 > 解决方案 > 从表中找到至少在这些技术[reactjs, mysql, express] 方面工作过的人

问题描述

我有一个包含名称和技术字段的表。

-----------------------------
|name       | technologies  |
-----------------------------
|shashin    | reactjs       |
-----------------------------
|shashin    | mysql         |
-----------------------------
|krupali    | express       |
-----------------------------
|paras      | mysql         |
-----------------------------
|shashin    | express       |
-----------------------------
|paras      | php           |
-----------------------------
|krupali    | php           |
-----------------------------
|shashin    | php           |
-----------------------------

我想找一个至少在所有这些技术[reactjs, mysql, express] 中工作过的人名。

输出:

-------------
|name       |
-------------
|shashin    |
-------------

标签: mysqlsql

解决方案


您可以尝试如下。

select name from TableName
group by name
having count(distinct technologies) > 2

如果你想要特定的技术,你可以尝试如下。

 select name from TableName
 where technologies in('reactjs', 'mysql', 'express')
 group by name
 having count(distinct technologies) > 2

推荐阅读