WEB开发网
开发学院数据库MySQL MySQL Join详解 阅读

MySQL Join详解

 2005-11-06 17:40:07 来源:WEB开发网   
核心提示: 还是先 Create table 吧 create table emp( id int not null Prima(最完善的虚拟主机管理系统)ry key, name varchar(10) ); create table emp_dept( dept_id varchar(4) not null,

  还是先 Create table 吧

  create table emp(
  id int not null Prima(最完善的虚拟主机管理系统)ry key,
  name varchar(10)
  );

  create table emp_dept(
  dept_id varchar(4) not null,
  emp_id int not null,
  emp_name varchar(10),
  Prima(最完善的虚拟主机管理系统)ry 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");

1 2 3 4 5  下一页

Tags:MySQL Join 详解

编辑录入:coldstar [复制链接] [打 印]
赞助商链接