asp.net - SQL Query Problem With Three Tables -
i've got 3 tables, want select 2 columns first table , 1 last table displayed in gridview asp.net
so have table sprint, task , blocked.
i want display currentstatus blocked table , need use task table join them together. i've attempted query below doesn't work.
can me on please, appreciated.
thanks
the way doing now, doing
- first left join on task (which keeps sprint entries without task) and
- then inner join on blocked (which removes sprint entries don't have blocked entry).
basically, need inner join task , blocked first, then right join sprint (which gets sprints):
select tblsprint.sprintid, tblsprint.projectid, tblblocked.currentstatus tbltask inner join tblblocked on tbltask.taskid = tblblocked.taskid right join tblsprint on tbltask.sprintid = tblsprint.sprintid alternatively, if that's easier understand you, can write this: left join sprint already combined task-blocked data.
select tblsprint.sprintid, tblsprint.projectid, tblblocked.currentstatus tblsprint left join (tbltask inner join tblblocked on tbltask.taskid = tblblocked.taskid) on tblsprint.sprintid = tbltask.sprintid
Comments
Post a Comment