mysql multi table federated query returns the content implementation code for a single table

  • 2020-05-14 05:14:32
  • OfStack

Today, when using the mysql statement, the statement is as follows:
Sql code
 
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 

In the consol console, I found the sql statement printed by hibernate, and when I got the mysql statement, I always reported an error, indicating that Unknown column 'sapcle' in 'field list'. According to the SellApplyPermitChangeList sapcle definition, SellApplyPermitChangeList sapcle should have no problem, but I found out after asking my colleagues that it could be written like this in java statement, but it should be changed when used in mysql editor

Sql code
 
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 

Related articles: