mysql - get updated date field row after inner joining table -


i have situation row inserted whenever schedule created call_back_date value la_id same each row, want recent row max(call_back_date) have written query fetch entries schedule after inner joining 3 tables:

select la_details.application_no,  la_details.id la_det, la_details.client_id client_id, la_details.la_name la_name, la_details.sex sex, la_details.advisor_name advisor_name, la_details.client_phone client_phone, la_details.client_mobile client_mibile, la_details.level level, la_details.state state, la_details.pin_code pin_code, trans_schedules.id schedule_id,  trans_schedules.*,  comments.descriptions la_details inner join trans_schedules  on  trans_schedules.la_id=la_details.id inner join comments   on  comments.comment_id=trans_schedules.comment_id (trans_schedules.comment_id<>'1'  or trans_schedules.list_followup = '1' or trans_schedules.counter_flag='0')  ,  la_details.case_closed='0' order  trans_schedules.call_back_date  ) a1 inner join  ( select la_id,max(call_back_date) call_back_date trans_schedules group la_id                                                                ) b1 on a1.la_det = b1.la_id , a1.call_back_date  = b1.call_back_date 

my question how use subquery on previous query max call_back_date row in advance help!!!!

for mysql:

select last_insert_id();

it give last inserted identity record


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -