Welcome! Log In Create A New Profile

Advanced

SQL Related Question

Posted by RynoE 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar SQL Related Question
October 21, 2009 03:43PM
this is my SQL query

SELECT * FROM registration.course_student INNER JOIN registration.student WHERE registration.course_student.cid =1



The problem is i keep geting doubles of all the records even thou there are nou doul recordes in the table?? any direction would be appreciated...


Thanks
avatar Re: SQL Related Question
October 21, 2009 04:19PM
Hey Rynoe...

Try this:

select * FROM course_student INNER JOIN course ON course_student.cid = course.cid and course_student.cid = 1

Stanton
avatar Re: SQL Related Question
October 23, 2009 11:45AM
Hi,

Thanks for teh help Stanton. But what i did to solve my problem was i used a LEFT JOIN in stead of a INNER JOIN!

SELECT * FROM course_student LEFT JOIN student ON course_student.sno = student.sno WHERE course_student.cid = 1

Cheers
Ryno
avatar Re: SQL Related Question
October 23, 2009 12:51PM
Hi,

Thanks for teh help Stanton. But what i did to solve my problem was i used a LEFT JOIN in stead of a INNER JOIN!

SELECT * FROM course_student LEFT JOIN student ON course_student.sno = student.sno WHERE course_student.cid = 1

Cheers
Ryno
avatar Re: SQL Related Question
October 23, 2009 03:38PM
Ah pretty good idea...

I've worked with SQL for the past two years now, every day in firebird databases. Moving on to Oracle soon as the bank upgrades, so i'll have to start using PLSQL. Looking forward to it!
Sorry, only registered users may post in this forum.

Click here to login