SQL。如何映射两列频率?

时间:2013-06-15 04:50:50

标签: sql select count

我有这个PROJECT表:

    PJNO  TASKNO        DESCRIP                     Other... 
    5555    11        Prototype New Screens       
    4444    21        Test First Prototype      
    5555    13        Create Test Plan           
    6666    73        Prototype Custom Screens  
    7777    73        Present Test Plan        
    3333    81        Install PT-Sale Package   
    7777    74        Conduct Tests               
    5555    12        Convert Data Files        

我需要列出至少包含2个任务的所有项目。

SELECT PJNO
FROM PROJECT
WHERE // COUNT TASKNO... here I am not sure how to introduce a conditional statement?    

1 个答案:

答案 0 :(得分:2)

SELECT PJNO
FROM PROJECT
GROUP BY PJNO
HAVING COUNT(TASKNO)>1;