-5

誰かが SQL クエリを書くのを手伝ってくれます。わかりませんが、迅速な修正が必要なだけです。

私はこのようなことを試みていました:

select college.colg_id,  
       college.student_id, 
       student.student_name from college,
       student     
       where college.student_id=student.student_id;

これにより、よくわからないすべてのデータが得られます。

colg_id student_id
1           1
1           2
1           3
1           4
2           5
2           6

student_id  student_name
1            a1
2            b1
3            c1
4            d1
5            e1
6            f1         

次の形式のデータが必要です

colg_id | student_id | student_name.
4

1 に答える 1

2
SELECT c.colg_id, c.student_id, s.student_name FROM college c
LEFT JOIN student s ON s.student_id = c.student_id
于 2013-10-11T09:51:48.283 に答える