I am trying to join three tables in SQL. I am using the following query but it is not working
select *
from char_level as c1 right join (SELECT distinct character_id as fid, target_character_dbid as tid FROM house
where reason='set_house_access' or reason='remove_house_access' and character_id is not null and target_character_dbid is not null)as vd on c1.character_id==vd.fid left join char_level as c2 on c2.character_id==vd.tid
can anyone help?