i current have table project(id) , table project_step (id, project,step(integer)).
1 project linked 1 or many project_step.
i want list of project last entered project_step (project_step.id desc) has step = x.
i need in sub query don't know how write it.
this query return column both tables. purpose of subquery separately latest id
every project
on table project_step
.
select a.*, b.* project inner join project_step b on a.id = b.project inner join ( select project, max(id) id project_step group project ) c on b.project = c.project , b.id = c.id b.step = ?
Comments
Post a Comment