mysql多表結合查詢前往一張表的內容完成代碼。本站提示廣大學習愛好者:(mysql多表結合查詢前往一張表的內容完成代碼)文章只能為提供參考,不一定能成為您想要的結果。以下是mysql多表結合查詢前往一張表的內容完成代碼正文
明天在應用mysql語句的時刻總是報錯,語句以下:
Sql代碼
SELECT sapcle FROM SellEnterpriseBaseInfor sebie,SellEnterpriseBaseInforVer sebive,SellApplyPermitChangeList sapcle
WHERE 1=1 AND sebie.iVerID = sebive.id AND sapcle.iEnterpriseBaseInforID=sebive.id AND sapcle.iState=1 AND sapcle.iEnterpriseID=11027516 AND sapcle.id=84
在consol掌握台,查詢到hibernate打印出來的sql語句,拿到mysql外面查詢的時刻總是報錯,提醒Unknown column 'sapcle' in 'field list',依照前面界說的 SellApplyPermitChangeList sapcle應當曾經沒成績了,問了同事才發明,在java語句外面可以這麼寫,然則在mysql編纂器外面應用的時刻要改成
Sql代碼
SELECT sapcle.* FROM SellEnterpriseBaseInfor sebie,SellEnterpriseBaseInforVer sebive,SellApplyPermitChangeList sapcle
HERE 1=1 AND sebie.iVerID = sebive.id AND sapcle.iEnterpriseBaseInforID=sebive.id AND sapcle.iState=1 AND sapcle.iEnterpriseID=11027516 AND sapcle.id=84