0
我使用mySQL,我试图找到一个表或另一个表中的行。 下面是表及其字段:从这两个表中选择值
user: id(PK), email, password, is_teacher
teacher: id, no_teacher(PK), name, id_group, no_class
teacher_information:no_teacher, cell_phone, SSN, email
student: id, no_student(PK), name, id_group, no_class
student_information:cell_phone, email, grade, no_student
user_role: id, id_role(PK)
group_leader: id_group, id_role
group_member: id_group, id_role
group: id_group(PK), name
每个用户(教师或学生)可以在一组组长或成员(不是两个),并且任何用户都可以在不同的组。 我想要列出与他的姓名和电子邮件有关的特定组中的每个人。 任何人都可以帮助我得到这个场景的sql查询吗?
你的意思是你想拥有的组表中的记录任何组的每个成员或者是你想过滤一个特定的组? – thaspius 2014-09-05 15:50:39
尽量避免使用保留字作为表格/列标识符 – Strawberry 2014-09-05 15:51:14
我无法弄清楚你想要什么。请添加示例数据和所需输出。 – 2014-09-05 15:51:40