Q&A about the site for Joomla! administrators, users, developers and designers
select q.id as id, '21' as type_id, q.title as 'short_desc', '11' as owner_id, q.creationdate as create_date, isnull(q.lasteditdate,q.creationdate) as update_date, '34' as status_id, 'T' as content_type, '0' as org_id from (SELECT id, title,creationdate, lasteditdate FROM Posts WHERE PostTypeId = 1 ) q INNER JOIN (SELECT COUNT(*) AS answers, parentid FROM Posts WHERE PostTypeId = 2 group by parentid ) a on q.id = a.parentid where a.answers > 0 order by id