首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

请问SQL语句

2012-04-10 
请教SQL语句SQL codeselect * from whemployeeinfor查询结果如下:EmpIdEmpNameEnterDate------- --------

请教SQL语句

SQL code
select * from whemployeeinfor查询结果如下:EmpId   EmpName  EnterDate  ------- -------- ---------- WHOFF06 李超       2006-09-13WHOFF07 冷勇       2007-10-24WHOFF10 熊元辉      2006-01-13WHOFF12 郑艳丽      2009-04-13WHOFF13 夏白帆      2006-04-04WHOFF15 张敏       2007-10-24WHOFF17 胡婷       2006-11-24WHOFF18 万燕       2006-08-01WHOFF21 杨静       2006-09-01(所影响的行数为 9 行)select attender as 加班员工,checker as 审核人,charger as 记帐人 from whovertimedetail查询结果如下:加班员工    审核人     记帐人    ------- ------- ------- WHOFF15   WHOFF17   WHOFF10WHOFF06   WHOFF17   NULL(所影响的行数为 2 行)




问题:我想得到查询结果加班员工,审核人,记帐人为whovertimedetail的员工姓名!

同时我想引用到Adodc1.RecordSource="SQL语句"中
即在MSHFlexGrid1显示出来时,出来的是员工姓名!


谢谢各位教我一下!!



[解决办法]
SELECT whemployeeinfor.EmpName AS 加班员工, whemployeeinfor_1.EmpName AS 审核人员, whemployeeinfor_2.EmpName AS 记账人

FROM 

((whovertimedetail LEFT JOIN whemployeeinfor ON whovertimedetail.attender = whemployeeinfor.EmpId) LEFT JOIN whemployeeinfor AS whemployeeinfor_1 ON whovertimedetail.checker = whemployeeinfor_1.EmpId) LEFT JOIN whemployeeinfor AS whemployeeinfor_2 ON whovertimedetail.charger = whemployeeinfor_2.EmpId;

热点排行