mysql - Advanced SQL Queries in Outsystems -


i have select list of projects user doesnot have access in given organization.

i tried query enter image description here

select {project}.[number],{project}.[name]  {project}  inner join {projectparticipant} on {project}.[id]={projectparticipant}.[projectid]  {project}.[tenant_id]=@tenantid , {projectparticipant}.[userid] <> @userid  group {project}.[number],          {project}.[name]  order {project}.[number] 

but here lists projects within given organization. missing basic. tried using left outer join no use. me out

it looks want rows in project table there no corresponding row in projectparticipant table given userid.

this should trick:

select {project}.[number],{project}.[name] {project} {project}.[tenant_id]=@tenantid , not exists (     select * {projectparticipant}      {project}.[id]={projectparticipant}.[projectid]     , {projectparticipant}.[userid] = @userid ) order {project}.[number] 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -