SELECT text_modalities.page_identity_id, article_date as update_date, article_title as update_title, created_by as ministry_leader,
ministry_desc, article_id, mission_statement, author_name,
(SELECT rtrim(first_name) + ' ' + rtrim(last_name) from users where user_id = created_by) as u_by,
file_content1, file_content2, file_content3
FROM text_modalities, ministries
WHERE text_modalities.ministrY_id = ministries.ministry_id
AND ministries.ministry_id = 141
AND text_modalities.article_type = 'M'
aND article_id = (SELECT max(article_id) FROM text_modalities x WHERE article_type = 'M'
AND x.ministry_id = ministries.ministry_id AND article_date = (SELECT max(article_date)
FROM text_modalities y WHERE article_type = 'M' AND Y.ministry_id = ministries.ministry_id))
|