0
에서 하위 쿼리를 작성하는 방법 :나는이 같은 SQL이 기준
Select tbl.id, tbl.name
From
(select table1.id, table1.name
from table1
inner join table2 on table1.id = table2.id
order by table2.priority
) tbl
group by table1.id
order by table1.name
내가 달성하기 위해 노력하고있어 첫 번째 정렬하는 것입니다 (table2.priority
에 의해 순서), 다음 우선 순위가 가장 높은 table1.id, name
로 레코드를 가져 . table1
table2
에 많은 하나이기 때문에 주, MAX(table2.priority)
, 여기에 작동하지 않는, 한 표 레코드에 대해, 표 2는 가장 높은 우선 순위 = 1와 N 레코드가 할 수있는 가장 높은 우선 순위를 가진 다른 표 기록 = 3