Use this sql query to get your result:
SELECT a.first_name,
a.last_name,
a.email,
a.phone,
b.level,
b.user_id
from passport a
INNER JOIN user c
ON a.id=c.passport_id
INNER JOIN consultant b
ON b.user_id=c.id
Try to do an inner or left join. Something like this:
SELECT a.first_name, a.last_name, a.email, a.phone, b.* from passport a
LEFT JOIN user b
ON a.id=b.passport_id
I can't see from your screenshot what the field names are for Consultant and Level hence the b.*
to pickup all the fields from that table (I assume it IS on that table?). Anyway you can customize this query easily.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.