Mysql
 sql >> Database >  >> RDS >> Mysql

MySQL JOIN restituisce campi NULL

Non sono sicuro dei tuoi dati e dello schema, ma se up.profile_value è come "123", puoi provare questo:

SELECT u.name AS _user_name, s.name AS _school_name
FROM fwg_files AS f
LEFT JOIN users AS u ON u.id = f.user_id
LEFT JOIN user_profiles AS up ON up.user_id = u.id
LEFT JOIN school AS s ON CONCAT('"', s.id, '"') = up.profile_value