Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はこれらのテーブルを持っています
AssigenmentList--linksto --- School、AgeGroup
AssigenmentList
School
AgeGroup
Usersbirthdayそれに付いているだろう
Users
birthday
one to many
今、私は特定の学校にリンクされているすべての課題リストが子供の年齢と同じ年齢に属していることを望みます
原則として:
select a.*, b.*, c.* from A a inner join B b on a.idB = b.id inner join C c on b.idC = c.id
inner joinif a.idBmust have match を使用して、行を結果セットに追加します。a.idB(左側) が存在するだけで行を射影するのに十分な場合は、左外部結合。
inner join
a.idB
トリックは、最初のテーブルから、それらを結び付ける最後の列に移動することです。