Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
punkrocker937
Starting Member
2 Posts |
Posted - 2007-06-29 : 20:53:54
|
Let's say I have three tables: enrolled, student, course_sectionThey consist of:enrolled - student_id, term, course_codestudent - student_name, student_idcourse_section - course-num, dept_abbr, course_codeI want to end up with one table consisting of student_name, term, dept_abbr, and course_num. In that order. I don't want student names to repeat and also would like to have it sorted by term within student name. Please help. Thanks.Something like this:STUDENT_NAME TERM DEPT_ABBR COURSE_NUM------------------------------ ---- --------- ----------Adams S07 BIOL 1505 S07 CSIS 2610Davis X07 GEOG 2630Edwards S07 GEOG 2630 X07 MATH 1548 |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2007-06-29 : 21:04:42
|
smells like homework.do you want to show us what sql you have so far? elsasoft.org |
 |
|
punkrocker937
Starting Member
2 Posts |
Posted - 2007-06-29 : 21:20:35
|
I'm not sure how to start. Do I need to use joins? |
 |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-06-30 : 00:02:39
|
yes. use INNER JOIN KH[spoiler]Time is always against us[/spoiler] |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|