0
我有三个表如下,映射表连接查询
student
category
student_category
学生表有以下几列:
studentid, student name, studenttype
分类表中有如下表:
categoryid, categoryname, ..
student_category表具有以下列:
id, studentid, categoryid
现在我有2个输入参数categoryid and studenttype
所以现在我需要让它们与各自categoryid
和其学生类型相关联的所有学生细节studenttype
我试过如下未给予正确的结果,
SELECT
s.*
FROM
student s
JOIN
student_category sc ON sc.categoryid = 1;
而且我也需要过滤的学生,其studenttype
是“someinput”
我的工作PostgreSQL的。任何建议请