This is my query:
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))
ORDER BY b.date DESC
LIMIT 20 OFFSET 0
the problem is its printing duplicate result.
How can I optimize this one
please help
thanks
Three ways to solve this (basically you have more than 1 row in nwork):