It shows each row twice… I wrote it to pick some rows from different tables, it shows what I want but it shows those rows twice, each. why ?
SELECT
tbluser.fullname, tbluser.email, tblJobAdv.advtitle, tblPersonalInfo.country,
tblPersonalInfo.city, tblJobOffer.digitalsignature
FROM
tblUser
LEFT JOIN
tblPersonalInfo ON tblUser.userid = tblPersonalInfo.userid
LEFT JOIN
tblApplication ON tblApplication.userid = tblUser.userid
LEFT JOIN
tblJobAdv ON tblJobAdv.advid = tblApplication.advid
LEFT JOIN
tblJobOffer ON tblUser.userid = tblJobOffer.userid
WHERE
tblJobAdv.userId IN (SELECT userid FROM tblUser WHERE email = 'h@y.com')
using ‘group by’ or ‘distinct’ makes your query slow and inefficient.
I think you would better finding duplicated rows from other tables like tblJobAdv,
and give some more ‘where condition’ to those tables.