 <p>If I'm not misunderstanding your question, this will work:</p> <pre><code>SELECT PE.PROJECT_ESTIMATES_ID, IF( PE.PROJECT_ESTIMATES_ID = '046a190e-a895-4ce2-bb10-7a583d648b99', 0, PE.PROJECT_ESTIMATES_ID) AS STEP_DESCRIPTION FROM PROJECT_ESTIMATES PE, MST_PIPELINE_STEPS MPS WHERE PE.`PROJECT_BASIC_INFORMATION_ID` ='29ab9760-c75b-4479-882c-bc84426d55ac' AND PE.`TENANT_ID`='{0559cdcb-c63b-4c81-be91-b78Tenant1000' AND PE.PIPELINE_STEP_ID=MPS.PIPELINE_STEP_ID ORDER BY PE.MODIFIED_DATE DESC </code></pre> <p>Unless of course you meant you want zero rather than blank or null in which case this is what you want:</p> <pre><code>SELECT PE.PROJECT_ESTIMATES_ID IF( LENGTH (ISNULL( PE.PROJECT_ESTIMATES_ID,'')) &gt; 0, PE.PROJECT_ESTIMATES_ID, 0) AS STEP_DESCRIPTION FROM PROJECT_ESTIMATES PE, MST_PIPELINE_STEPS MPS WHERE PE.`PROJECT_BASIC_INFORMATION_ID` ='29ab9760-c75b-4479-882c-bc84426d55ac' AND PE.`TENANT_ID`='{0559cdcb-c63b-4c81-be91-b78Tenant1000' AND PE.PIPELINE_STEP_ID=MPS.PIPELINE_STEP_ID ORDER BY PE.MODIFIED_DATE DESC </code></pre>