《MYSQL教程mysql多表聯(lián)合查詢返回一張表的內(nèi)容實(shí)現(xiàn)代碼》要點(diǎn):
本文介紹了MYSQL教程mysql多表聯(lián)合查詢返回一張表的內(nèi)容實(shí)現(xiàn)代碼,希望對您有用。如果有疑問,可以聯(lián)系我們。
今天在使用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應(yīng)該已經(jīng)沒問題了,問了同事才發(fā)現(xiàn),在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
轉(zhuǎn)載請注明本頁網(wǎng)址:
http://www.snjht.com/jiaocheng/5942.html