Click here to Skip to main content
15,917,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello i am new on mysql
i try write this procedure but its not work
can explain why ?
this is my stored procedure

SQL
DELIMITER $$

 CREATE DEFINER=`root`@`localhost` PROCEDURE `spr_GetInformation`(
              IN cos_ID INT
              )
BEGIN
SELECT
               students.ID as 'StudentID',
               course.ID as 'CourseID',
               students.name,
               course.course_name,
               course.cost_fee,
               students_Course.net_cost
      FROM
               students INNER JOIN  students_course on students.ID     = students_course.students_ID
               inner join course on course_ID = students_course.course_ID
      where
               course.ID = cos_ID;
Posted

1 solution

is
inner join course on course_ID

supposed to be
inner join course on course.ID
 
Share this answer
 
Comments
Member 10405755 12-Feb-14 3:05am    
i solve it

DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `spr_GetInformation`(IN cos_ID INT)
BEGIN
SELECT
students.ID as 'StudentID',
course.course_ID as 'CourseID',
students.name,
course.course_name,
course.course_cost,
students_Course.cost_net
FROM
students INNER JOIN students_course on students.ID= students_course.ID
inner join course on course.course_ID = students_course.ID
where
course.course_ID = cos_ID;

END

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900