Q:

How to filter twice using subquery?

I was trying to select data where the constraints are contradictory. For example there are dataset that contains status_desc as '90 - Lost Opportunity' when the Sproject_Number is not null. I wanted to filter it twice so first i get all Sproject_number as null and then i am able to filter this query again to get a table where the status_desc is '90-Lost Opportunity'
SELECT ProjectNumber,
       PName
FROM
(
    SELECT DISTINCT
           T0.project_number_ext AS ProjectNumber,
           T0.project_key AS PKey,
           T0.sproject_number AS sPNumber,
           T0.project_number AS PNumber,
           T0.schedule_finish AS SFinish,
           T0.status_desc AS SDesc,
           T0.Project_name AS PName
    FROM trimergo.rpt_getProjectPOC T0
    WHERE T0.sproject_number IS NULL
)
GROUP BY ProjectNumber,
         PName;

A:

I think you just need this. There is no need for the subquery.
SELECT 
        DISTINCT 
         T0.project_number_ext as ProjectNumber
        ,T0.status_desc as SDesc
        ,T0.Project_name as PName
    From trimergo.rpt_getProjectPOC T0
    WHERE T0.sproject_number IS NULL AND 
    ( T1.SDesc LIKE '10 - In Proposal%' OR T1.SDesc like '90-Lost Opportunity%' )

