SQL Access - Transpose Multiple results into one row -


i struggling following problem new sql.

problem: projtask table has multiple tasks 1 project. need transpose results show statuses (e.g. task 150, 130, 110, 70 status) every task on single result row against 1 project.

at moment coming multiple result rows against 1 project due number of tasks associated project. hope makes sense. if not please probe. thanks, appreciated :)

ultimately want result like:

project x - task 10 - status c - task 130 - status - task 150 - status c project y - task 10 - status - task 130 - status c - task 150 - status project z - task 10 - status c - task 130 - status c - task 150 - status c   select iif(dbo_projtask.[task-num]=150 , dbo_projtask.stat='c','released') 150_status, dbo_projtask.[proj-num],        iif(dbo_projtask.[task-num]=130 , dbo_projtask.stat='a','active') 130_status dbo_projtask group iif(dbo_projtask.[task-num]=150 , dbo_projtask.stat='c','released'), dbo_projtask.[proj-num],          iif(dbo_projtask.[task-num]=130 , dbo_projtask.stat='a','active');** 

not sure if understand correctly, trying create columns tasks under project doesn't sound scalable solution. why not create resultset projectid, taskid , statusid , processing/modifications clietside? relational databases tend not ragged/dynamic columns much. if absolutely set on proposed structure you'd need build dynamic query uses pivot construction of sorts, have doubts whether work if have flexible number of tasks per project.


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 -