MYSQL选择参与所有项目的id

MYSQL选择参与所有项目的id,mysql,Mysql,我有表名“workOnlist” 列是 ID,projectNum values are 1 , 1229 2 , 1229 3 , 3370 2 , 3370 1 , 4400 2 , 4400 3 , 4400 如何显示涉及所有项目的ID(112933704400) 从Worknlist中选择ID,其中(完成所有1129、3370、4400的ID)如果您知道项目的数量,则可以使用此选项: select ID from workonlist group by id having

我有表名“workOnlist”

列是 ID,projectNum

values are
1  , 1229
2  , 1229
3  , 3370
2  , 3370
1  , 4400
2  , 4400
3  , 4400
如何显示涉及所有项目的ID(112933704400)


从Worknlist中选择ID,其中(完成所有1129、3370、4400的ID)

如果您知道项目的数量,则可以使用此选项:

select ID from workonlist
group by id
having count(distinct(projectNum))=3;
select ID from workonlist
group by id
having count(distinct(projectNum))=
            (select count(distinct(projectNum)) from workonlist);
或者,您可以使用:

select ID from workonlist
group by id
having count(distinct(projectNum))=3;
select ID from workonlist
group by id
having count(distinct(projectNum))=
            (select count(distinct(projectNum)) from workonlist);

如果您知道项目的数量,那么您可以使用:

select ID from workonlist
group by id
having count(distinct(projectNum))=3;
select ID from workonlist
group by id
having count(distinct(projectNum))=
            (select count(distinct(projectNum)) from workonlist);
或者,您可以使用:

select ID from workonlist
group by id
having count(distinct(projectNum))=3;
select ID from workonlist
group by id
having count(distinct(projectNum))=
            (select count(distinct(projectNum)) from workonlist);

如果您知道项目的数量,那么您可以使用:

select ID from workonlist
group by id
having count(distinct(projectNum))=3;
select ID from workonlist
group by id
having count(distinct(projectNum))=
            (select count(distinct(projectNum)) from workonlist);
或者,您可以使用:

select ID from workonlist
group by id
having count(distinct(projectNum))=3;
select ID from workonlist
group by id
having count(distinct(projectNum))=
            (select count(distinct(projectNum)) from workonlist);

如果您知道项目的数量,那么您可以使用:

select ID from workonlist
group by id
having count(distinct(projectNum))=3;
select ID from workonlist
group by id
having count(distinct(projectNum))=
            (select count(distinct(projectNum)) from workonlist);
或者,您可以使用:

select ID from workonlist
group by id
having count(distinct(projectNum))=3;
select ID from workonlist
group by id
having count(distinct(projectNum))=
            (select count(distinct(projectNum)) from workonlist);
试试这个

select ID from workOnlist Where id IN(1129, 3370, 4400)
试试这个

select ID from workOnlist Where id IN(1129, 3370, 4400)
试试这个

select ID from workOnlist Where id IN(1129, 3370, 4400)
试试这个

select ID from workOnlist Where id IN(1129, 3370, 4400)

它起作用了!你知道如何获得项目的数量吗!你知道如何获得项目的数量吗!你知道如何获得项目的数量吗!你知道如何获得项目数量吗