mysql - Where not equal to substrings array -


so have 2 tables, 1 called cmdr_group , 1 called groupuser. attempting list of groups user not in, proving difficult. groupuser has multiple users each group, each own id.

now understand why query won't work putting here demonstrate thought process.

select t1.*, t2.userid cmdr_group t1 left join groupuser t2 on t2.groupid = t1.id t1.id != (select groupid groupuser userid=90792652); 

if need information in tables let me know.

now think understand. approach using not exists or not in:

select g.* cmdr_group g not exists (select 1                   groupuser gu                   gu.userid = 90792652 ,                         gu.groupid = g.id                  ); 

this query follows question. overall query fetching groups. not exists checking user not in group.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -