here is my SQL statement , i would like to find all the games that have the status 0 and names of teams that are like key_word or the sport's name that are like the key word. The problem is that all the games that are displayed don't have status 0 . What am i doing wrong?
sql="select * from games where games.status=0 and games.team_2_id
IN (select id from teams where name like '"+key_word+"')
or games.team_1_id
IN (select id from teams where name like '"+key_word+"')
or games.sport like '"+key_word+"'
"