When I include an internal in the change_management table, I'm getting duplicate value again. It gives three records but I only want cmp.id most recently.
select "mpg_request cr INNER CMP .change_request_fk = cr.id WHERE cr.release_fk" as cmp.id, cr.id, coalesce (cmp.effort, 0.00) Include the maximum (ID) max maximum (CMD.ID) included in the form of the = 509
(ID, change_request_fk, id, change_request_fk, attempts by the m_change_management group by attempt) This is needed to return the most recent record. Any ideas how can I fix it?
get solution
select cmp.id, cr.id, Cr.number as "psl #" to m_change_request cr LE left JOIN m_change_management cmp ON cr.id = cmp.change_request_fk LEFT JOIN m_change_management cmp2 ON cr.id = cmp2.change_request_fk and cmp.id & lt; Cmp2.id WHERE cr.release_fk = 509 and cmp2.change_request_fk is Null
Comments
Post a Comment