mysql - Advanced SQL Queries in Outsystems -
i have select list of projects user doesnot have access in given organization.
i tried query
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
Post a Comment