sql server - get table without Added column in sql query -


i have process table in sql server database this:

process table

i need select process if rolename exists in roletable this:

 select id,workflowxml           (     select m.c.value('@rolename','nvarchar(max)') rolename,p.*     process p     outer apply p.workflowxml.nodes('/workflow/tasks/task[@type="start"]/taskusers/taskuser') m(c)     ) pro pro.rolename in     (select * roletable) 

in select rolename adds process. need process table. can add process fields (id,workflowxml) query. if change process table design should edit query. not good.

is there way select process table in query without adding process fields this?

select pro                  (         select m.c.value('@rolename','nvarchar(max)') rolename,p.*         process p         outer apply p.workflowxml.nodes('/workflow/tasks/task[@type="start"]/taskusers/taskuser') m(c)         ) pro pro.rolename in         (select * roletable) 

thanks.

you can join table like:

select p.* process p outer apply p.workflowxml.nodes('/tasks/task[@type="start"]/taskusers/taskuser')  m(c) inner join roletable r      on r.rolename = m.c.value('@rolename','varchar(max)')  

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -