lenamtl
asked on
SELECT JOIN on 3 tables
Hi,
I need to change this MySQL request to display other field from third table.
I need to display a field jos_comprofiler.member from jos_comprofiler
JOIN jos_comprofiler.user_id
I have try different way to JOIN the third table without success
Thanks
I need to change this MySQL request to display other field from third table.
SELECT jos_users.name, jos_acctexp_subscr.expiration
FROM jos_acctexp_subscr
LEFT JOIN jos_users ON jos_acctexp_subscr.userid = jos_users.id
WHERE jos_acctexp_subscr.status ='Active'
ORDER BY jos_users.id ASC
I need to display a field jos_comprofiler.member from jos_comprofiler
JOIN jos_comprofiler.user_id
I have try different way to JOIN the third table without success
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
it's working ok
using = jos_comprofiler.user_id
it's working ok
using = jos_comprofiler.user_id
SELECT jos_users.name, jos_acctexp_subscr.expirat
FROM jos_acctexp_subscr
LEFT JOIN jos_users ON jos_acctexp_subscr.userid = jos_users.id
WHERE jos_acctexp_subscr.status ='Active'
ORDER BY jos_users.id ASC
to:
SELECT US.name, SB.expiration, CP.Member
FROM jos_acctexp_subscr SB
LEFT JOIN jos_users US ON SB.userid = US.id
Left join jos_comprofiler CP on CP.user_id=US.ID
WHERE SB.status ='Active'
ORDER BY US.id ASC