我在Mysql数据库中有两个表,表1。
serial Remark
-------------------
1 programming in c++
2 OOPS using java 和表2
Name date code serial
-------------------------------------
Jack 2014-10-07 c++ 1
Jill 2014-10-07 c++ 1
Moos 2014-10-07 c++ 1
Jack 2014-10-08 java 2
Jill 2014-10-08 java 2我想在HTML中使用php生成多个表格,
1.学习c++编程的学生有
Name date
-------------------
Jack 2014-10-07
Jill 2014-10-07
Moos 2014-10-072.使用java的OOPS中的学生
Name date
-------------------
Jack 2014-10-08
Jill 2014-10-08有人能推荐这个查询吗?
发布于 2014-10-08 12:39:49
查询案例1:
SELECT name, date from table2 inner join table1 on table2.serial = table1.serial where Remark='programming in c++'查询案例2:
SELECT name, date from table2 inner join table1 on table2.serial = table1.serial where Remark='OOPS using java'或,
另一种方式:
查询案例1:
SELECT name, date from table2, table1 where table2.serial = table1.serial and Remark='programming in c++'查询案例2:
SELECT name, date from table2, table1 where table2.serial = table1.serial and Remark='OOPS using java'https://stackoverflow.com/questions/26249159
复制相似问题