我想知道这段mysql语句错在哪,求大神指教!
SELECTa.No,a.EmpNo,a.Name,a.Email,a.Tel,b.FK_Duty,b.FK_Dept,d.NameasDetpName,c.Nameas...
SELECT a.No,a.EmpNo,a.Name,a.Email,a.Tel,b.FK_Duty,b.FK_Dept,d.Name as DetpName, c.Name as DutyName, b.DutyLevel,b.Leader,
INSERT((SELECT ','+e.Name FROM Port_DeptEmpStation d,Port_Station e
WHERE d.FK_Station = e.No AND d.FK_Emp=a.no GROUP_CONCAT('')),1,1,'')
AS Stations FROM Port_Emp a, Port_DeptEmp b , Port_Duty c,Port_Dept d
WHERE A.No=B.FK_Emp AND b.FK_Duty=c.No and b.FK_Dept=d.No
and (a.No like '%admin%' OR a.Name like '%admin%' OR a.EmpNo like '%admin%') order by a.No 展开
INSERT((SELECT ','+e.Name FROM Port_DeptEmpStation d,Port_Station e
WHERE d.FK_Station = e.No AND d.FK_Emp=a.no GROUP_CONCAT('')),1,1,'')
AS Stations FROM Port_Emp a, Port_DeptEmp b , Port_Duty c,Port_Dept d
WHERE A.No=B.FK_Emp AND b.FK_Duty=c.No and b.FK_Dept=d.No
and (a.No like '%admin%' OR a.Name like '%admin%' OR a.EmpNo like '%admin%') order by a.No 展开
1个回答
展开全部
SELECT a.No,a.EmpNo,a.Name,a.Email,a.Tel,b.FK_Duty,b.FK_Dept,d.Name as DetpName, c.Name as DutyName, b.DutyLevel,b.Leader,
(SELECT ','+GROUP_CONCAT(e.Name) FROM Port_DeptEmpStation d,Port_Station e
WHERE d.FK_Station = e.No AND d.FK_Emp=a.no )
AS Stations FROM Port_Emp a, Port_DeptEmp b , Port_Duty c,Port_Dept d
WHERE A.No=B.FK_Emp AND b.FK_Duty=c.No and b.FK_Dept=d.No
and (a.No like '%admin%' OR a.Name like '%admin%' OR a.EmpNo like '%admin%') order by a.No;
为什么有insert
追问
网上差的 就跟sqlserver里面的STUFF一样 我也是第一次用mysql 不知道对不对
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询