select *,(select state from table2 where table1.id=table2.id) from table1
试试
试试
解决方案 »
- 谁有关于进销存系统设计的文献综述,毕业设计急等!
- 往两个表里添加数据的问题?
- “用聚合索引比用不是聚合索引的主键速度快 ”该怎么理解?
- 呵呵:一个表中有1600万,用循环怎么写,每次删除100万
- Analysis Services如何配置匿名登录?
- 如何将一个表中的数据更新到另外一个表中??
- 谁有中文版的sqlserver7.0?
- sqlserver2000恢复7.0备份的数据库,存储过程调试不通过问题
- 大力好!请教问题.
- 十万火急,关于sql serve(愿意献出所有的分数)
- 怎么用sql语句取出‘2002-10-4 10:01:15:763’当中的‘2002-10-4’ ?
- restore数据库时,如果要恢复到最近一次备份,file=什么?
select * from table1 full join table2 on table1.id=table2.id
or:
select * from table1 left join table2 on table1.id=table2.id
select * from table1 full join table2 on table1.id *= table2.id就可以了
select a.id,a.name,b.state from table1 a,table b where a.id *= b.id就可以了
from 表名 left[right] outer join 表名
on
表名.引用列名 连接操作符 表名.引用列名