首页 >后端开发 >php教程 >MySQL Join详解_PHP教程

MySQL Join详解_PHP教程

WBOY
WBOY原创
2016-07-13 17:02:161047浏览

还是先 Create table 吧
create table emp(
id int not null primary key,
name varchar(10)
);
create table emp_dept(
dept_id varchar(4) not null,
emp_id int not null,
emp_name varchar(10),
primary key (dept_id,emp_id));
insert into emp() values
(1,"Dennis-1"),
(2,"Dennis-2"),
(3,"Dennis-3"),
(4,"Dennis-4"),
(5,"Dennis-5"),
(6,"Dennis-6"),
(7,"Dennis-7"),
(8,"Dennis-8"),
(9,"Dennis-9"),
(10,"Dennis-10");
insert into emp_dept() values
("R&D",1,"Dennis-1"),
("DEv",2,"Dennis-2"),
("R&D",3,"Dennis-3"),
("Test",4,"Dennis-4"),
("Test",5,"Dennis-5");


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/631052.htmlTechArticle还是先 Create table 吧 create table emp( id int not null primary key, name varchar(10) ); create table emp_dept( dept_id varchar(4) not null, emp_id int not null, emp_name varc...
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn