mysql创建视图报错[Err] 1353

来源:互联网 发布:西门子plm软件是什么 编辑:程序博客网 时间:2024/06/06 01:55

主要错误原因就是括号里面的字段和查询出来的字段不一一对应


CREATE VIEW `v_breedlogtop`(youngId,strName,farmId,strAddress,strPhoneId,produceName,iCycCount,dtOccur,iBuiNum,iCount,iGivCount) AS
select
   Young.ID youngId,
   TermUser.strName strName,
   Farm.ID farmId,
   Farm.strAddress strAddress,
   TermUser.strPhoneId strPhoneId,
   Produce.ProduceName produceName,
   YouComInfo.iCycCount iCycCount,
   YouComInfo.dtOccur dtOccur,
   Building.iBuiNum iBuiNum,
   Young.iCount iCount,
   Young.iGivCount iGivCount
from
   TermUser,
   Farm,
   Building,
   YouComInfo,
   Young,
   Author,
   Produce
where
   Farm.ID = YouComInfo.FarmId
   and YouComInfo.ID = Young.iYouComInfoId
   and Farm.ID = Building.iFarmId
   and Farm.ID = Author.FARM_ID
   and TermUser.ID = Author.AUTHORED_ID
   and Produce.ID = YouComInfo.iProId
   and Building.ID = Young.iBuiId
group by
   Young.ID

0 0
原创粉丝点击