select distinct cust.no, cust.branch, cust.name, cust.surname, term.benefit, term.code,tehi.trcode, tehi.trancode, dmhi.trancode, dmd.benefit
from
cust as cust inner join term as term on cust.rowno = term.rowno_custterm_cust
inner join tehi as tehi on term.rowno =tehi.rowno_termtehi_term
inner join dmd as dmd on cust.rowno =dmd.rowno_custdmd_cust
inner join dmhi as dmhi on dmd.rowno =dmhi.rowno_dmddmhi_dmd
group by cust.no, cust.branch, cust.name, cust.surname, term.benefit, term.code,tehi.trcode, tehi.trancode, dmhi.trancode, dmd.benefit
having count(*) > 1
this doesn't even work..
if i delete the last row having count(*)>1 then it gives me duplicate values.
Please Advice how would i write this query.
THANKS