映射表mysql(innet join) [英] Mapping table mysql (innet join)
本文介绍了映射表mysql(innet join)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好我是mysql的新手
我尝试编写这个程序但是它不起作用
可以解释为什么?
这是我的存储过程
hello i am new on mysql
i try write this procedure but its not work
can explain why ?
this is my stored procedure
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;
推荐答案
创建 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
学生 INNER 加入 students_course students.ID = students_course.students_ID
inner 加入课程 course_ID = students_course.course_ID
其中
course.ID = cos_ID;
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;
是
inner join course on course_ID
应该是
supposed to be
inner join course on course.ID
这篇关于映射表mysql(innet join)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文