I have two table
In work rship table there is
date_start for each employee. For few employee date_start is duplicate so i have to choose the
min(date_start) from work rship table
for this i wrote a query :
REGEXP_SUBSTR(ASSIGNMENT_NAME, '[0-9]+') PERSON_NUMBER,
NVL( wrk.date_start,t.effective_start_date) ,
NVL( WRK.LEGAL_EMPLOYER_NAME, 'N/A')
COUNT(*) OVER (PARTITION BY assignment_name, effective_start_date, effective_end_date, effective_latest_change) AS c
LEFT OUTER JOIN
WHERE date_start =
(SELECT MIN(date_start) FROM apps.work_table
ON regexp_substr(t.assignment_name, '[0-9]+')=wrk.person_number
WHERE C =1;
But in the above query i did a mistake of just selecting select min(date_start) from apps.work_table this means min(date_start) from the entire table.
Instead of this i should have included the
regexp_substr(t.assignment_name, '[0-9]+')=wrk.person_number inside the inline query itself.
But now when i am including it.. its not working. can somebody point out the erroe.