- 0
- 0
- 约1.63千字
- 约 3页
- 2022-09-01 发布于云南
- 举报
多表查询与子查询源代码
1.相等连接查询
create table table2 (id int,telephone char(15));
insert into table2 values(2,1345312987);
insert into table2 values(3;
select * from table2;
select * from table1;
select table1.name,table2.telephone from table1,table2 where table1.id=table2.id;
2.不等连接查询
insert into table1 values(,王五);
select distinct name,telephone from table t1,table t2 where t1.id in t.id;
select *from table1;
select * from table2;
select id,name from table1 where id(select id from table2 where id2);
select id from table1 union select id from table2;
select id from table1 intersect select id
原创力文档

文档评论(0)