mysql #1349 - View's SELECT contains a subquery in the FROM clause 错误

mysql 运行 语句

drop view if exists   xiangqing;
create view  xiangqing(UserName,TrueName,MemberIDPrizeFee,AgentID,Mobile) as
select v.UserName,v.TrueName ,v.MemberID,v.PrizeFee,v.AgentID,v.Mobile from(select t.UserName,t.TrueName ,t.MemberID,t.PrizeFee,t.AgentID,a.Mobile from(
select c.UserName,c.TrueName,c.MemberID,b.PrizeFee,c.AgentID
from   Member as c  left join MemberFee as b on c.MemberID=b.MemberID
) as t  left join MemberDetail as a on  t.MemberID=a.MemberID) as v;

 

mysql  #1349 - View's SELECT contains a subquery in the FROM clause  错误

上网一查原来是个bug(我用的是mysql5.2) mysql 官网上有人问过。。。。。。

改成这样通过

drop view if exists   xiangqing;
create view  xiangqing(UserName,TrueName,MemberID,PrizeFee,AgentID,Mobile)  as
select c.UserName,c.TrueName,c.MemberID,b.PrizeFee,c.AgentID, a.Mobile
from  MemberDetail as a,MemberFee as b,Member as c where a.MemberID = c.MemberID and b.MemberID= c.MemberID;

郁闷弄了一天。。。。垃圾

 

你可能感兴趣的:(mysql #1349 - View's SELECT contains a subquery in the FROM clause 错误)