select a.id as id, a.parentid as primary_id, '12' as type...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla Meta

Q&A about the site for Joomla! administrators, users, developers and designers

select a.id as id, a.parentid as primary_id, '12' as type_id, Cast(a.body as varchar(255)) as short_desc,
'31' as owner_id, a.creationdate as create_date,
isnull(a.lasteditdate, a.creationdate) as update_date, '0' as status_id,
'T' as content_type, '0' as org_id from
posts a
where a.parentid in (
select q.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
)

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results