I have following query
SELECT ppa.project_type,ppa.segment1 project_no, ppa.project_id, pt.task_id,pt.WBS_LEVEL,pt.READY_TO_DISTRIBUTE_FLAG,pt.RECORD_VERSION_NUMBER,
FROM apps.pa_tasks pt, apps.pa_projects_all ppa
WHERE ppa.project_id = pt.project_id
AND ppa.segment1 IN ('172018')
-- and pt.READY_TO_DISTRIBUTE_FLAG = 'N'
AND pt.WBS_LEVEL in (select max(to_number(b.wbs_level)) from pa_tasks b where pt.task_id=b.task_id)
I want to select the max of wbs_level but the query is not working