sql - How to get the MAX result even if the MAX is different -


i have code pulling language knowledge , each employee has plan year, not complete them each year , in order recent 1 use max plan year. 1 of criteria whether or not willing move on seas, issue arises bring recent yes , recent no , need recent plan year whether yes or no, having difficulty troubleshooting this. code follows:

select employee_id, accept_international_assignment, max(plan_year) expr1  dbo.v_sc08_cd_employee_availabilities group employee_id, accept_international_assignment     

select a.employee_id, a.accept_international_assignment, a.plan_year  dbo.v_sc08_cd_employee_availabilities inner join (select employee_id, max(plan_year) maxplanyear             dbo.v_sc08_cd_employee_availabilities             group employee_id) m    on a.plan_year = m.maxplanyear , a.employee_id = m.employee_id 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -