准备环境MySql数据库,表跟数据如下,1表示男,0表示女
drop table test_report;
create table test_report(
id int(10),
name varchar(20),
sex int(1),
classes varchar(20),
age int(3),
primary key(id));
insert into test_report values(1,"张三", 1,"高一(1)班", 16); insert into test_report values(2,"张三2", 1,"高一(2)班", 16); insert into test_report values(3,"张三3", 1,"高一(3)班", 16); insert into test_report values(4,"张三4", 1,"高一(4)班", 16); insert into test_report values(5,"张三5", 1,"高一(5)班", 16); insert into test_report values(6,"张三6", 1,"高一(1)班", 16); insert into test_report values(7,"张三7", 1,"高一(2)班", 16); insert into test_report values(8,"张三8", 1,"高一(3)班", 16); insert into test_report values(9,"张三9", 1,"高一(4)班", 16); insert into test_report values(10,"张三10", 1,"高一(5)班", 16); insert into test_report values(11,"张三11", 1,"高一(1)班", 16); insert into test_report values(12,"张三12", 1,"高一(2)班", 16); insert into test_report values(13,"张三13", 0,"高一(3)班", 16); insert into test_report values(14,"张三14", 0,"高一(4)班", 16); insert into test_report values(15,"张三15", 1,"高一(5)班", 16); insert into test_report values(16,"张三16", 1,"高一(1)班", 16); insert into test_report values(17,"张三17", 1,"高一(2)班", 16); insert into test_report values(18,"张三18", 1,"高一(1)班", 16);
insert into test_report values(19,"李四", 1,"高一(1)班", 17);
在设计表的时候
第一张为传递参数表
第二张为根据参数查询出来的结果表
新建