Welcome!
Log In
Create A New Profile
Home
>
2009
>
PHP Sem 2
> Topic
Advanced
SQL Related Question
Posted by
RynoE
Announcements
Last Post
SoC Curricula
09/30/2017 01:08PM
Demarcation or scoping of examinations and assessment
02/13/2017 07:59AM
School of Computing Short Learning Programmes
11/24/2014 08:37AM
Unisa contact information
07/28/2011 01:28PM
Forums
Messages
New
RynoE
SQL Related Question
October 21, 2009 03:43PM
Registered: 14 years ago
Posts: 60
Rating: 0
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
Reply
Quote
stanimal
Re: SQL Related Question
October 21, 2009 04:19PM
Registered: 14 years ago
Posts: 70
Rating: 7
Hey Rynoe...
Try this:
select * FROM course_student INNER JOIN course ON course_student.cid = course.cid and course_student.cid = 1
Stanton
Reply
Quote
RynoE
Re: SQL Related Question
October 23, 2009 11:45AM
Registered: 14 years ago
Posts: 60
Rating: 0
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
Reply
Quote
RynoE
Re: SQL Related Question
October 23, 2009 12:51PM
Registered: 14 years ago
Posts: 60
Rating: 0
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
Reply
Quote
stanimal
Re: SQL Related Question
October 23, 2009 03:38PM
Registered: 14 years ago
Posts: 70
Rating: 7
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!
Reply
Quote
Newer Topic
Older Topic
Print View
RSS
Sorry, only registered users may post in this forum.
Click here to login