इसे हल करने के तीन तरीके (मूल रूप से आपके पास nwork में 1 से अधिक पंक्तियाँ हैं):
SELECT distinct b.id,b.body FROM btin b
INNER JOIN nwork n ON (n.mem_id = b.mem_id)
WHERE b.parentid = '0'
AND ('401' IN (n.frd_id, b.mem_id))
ORDER BY b.date DESC
LIMIT 20 OFFSET 0
SELECT b.id,b.body
FROM btin b
Where b.id in (SELECT b.id FROM btin b INNER JOIN nwork n ON (n.mem_id = b.mem_id)
WHERE b.parentid = '0' AND ('401' IN (n.frd_id, b.mem_id)))
ORDER BY b.date DESC
LIMIT 20 OFFSET 0
SELECT b.id,b.body FROM btin b
INNER JOIN nwork n ON (n.mem_id = b.mem_id)
WHERE b.parentid = '0'
AND ('401' IN (n.frd_id, b.mem_id))
Group by b.id, b.body, b.date
ORDER BY b.date DESC
LIMIT 20 OFFSET 0