mysql - Matching id reference between two tables and exclude result with connection user id -
i have 2 tables - simplified this:
//table player_img_id || player_img_category_id //table b user_play_uid || user_play_img_id (reference table a: player_img_id)
how show results table a exclude rows based on reference entries table b result_should_exclude_reference_with instance user_play_uid = 1
, user_play_img_id == player_img_id
.
basically want show results table dont have referenced user entry in table b. note: start of with, there no user entries in table b
any suggestions?
as suggested in comment found solution reading bit on joins here: http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html
the query needed following:
select * player_img left outer join user_play on user_play.user_play_entry_player_img_id = player_img.player_img_id , user_play.user_play_uid != $this->user_uid user_play.user_play_entry_player_img_id null
Comments
Post a Comment