select distinct t_Emp.*,t_Contract.*,t_Department.FName
from t_Emp,t_Contract,t_Department
where t_Emp.FItemID=1001
And t_Contract.FEmpID=1001
and t_Department.FItemID=t_Emp.FDepID
from t_Emp,t_Contract,t_Department
where t_Emp.FItemID=1001
And t_Contract.FEmpID=1001
and t_Department.FItemID=t_Emp.FDepID
解决方案 »
- 如何实现在一个数据库中.两个表的数据同步?
- 这句sql查询为什么不行?
- 我在使用mysql的时候,需要向我已经建立好的表内插入很多内容。sqlserver有很好的外部工具可以导入。mysql有没有啥好的导入方法?
- 把一个表中的部分数据移至另一个表有什么别的办法?
- 请问,如何将企业管理器中不用的SQL Server注册删除啊?
- 帮我看看这个递归存储过程为什么返回值总不对阿?急,在线
- 如何察看一个trigger是enable的还是disable的?
- 急求sql算法
- 菜鸟询一个sql查询语句
- DTC啟動不了,出現如下問題:Could not initialize the MS DTC XA transaction manager.
- 如何将数据从txt导入到SQLServer2005 和 从SQLServer2005导出到Excel
- 关于bulk insert用法求助
from t_Emp,t_Contract,t_Department
where t_Emp.FItemID=1001
And t_Contract.FEmpID=1001
and t_Department.FItemID=(select t_Emp.FDepID from t_Emp where t_Emp.FItemID=1001)
from t_Emp,t_Contract,t_Department
where t_Emp.FItemID=1001
And t_Contract.FEmpID=1001 但是因为t_Emp.ID只是一个ID,没有说明内容,要知道内容,就要连接到t_Department.FItemID才可以看到,所以我才好像问题那样写的,但是那样写的话,就什么都搜索不出来了.
select 学号,姓名
from 学生
where 所在系='MA'
GO
from t_Emp,t_Contract,t_Department
where t_Emp.FItemID=1001
And t_Contract.FEmpID=1001
and t_Department.FItemID=t_Emp.FDepID--这句代替t_Department.FItemID=(select t_Emp.FDepID from t_Emp where t_Emp.FItemID=1001)
--因为T_Emp表在上面出现过了