Home > database >  SQL statement error
SQL statement error

Time:09-22

Select distinct jianli. *, jianlitoufang jianliID, jianlitoufang. YonghuID from jianli, jianlitoufang where jianlitoufang. JianlitoufangID='" + num + "' and jianli. JianliID=jianlitoufang. JianliID and userName in (select userName from yonghu where yonghu. YonghuID=jianlitoufang. YonghuID

CodePudding user response:

 SELECT DISTINCT jianli. *, 
Jianlitoufang jianliID,
Jianlitoufang. YonghuID
The FROM jianli,
Jianlitoufang
WHERE jianlitoufang. JianlitoufangID='" + num + "'
AND jianli. JianliID=jianlitoufang. JianliID
AND the userName (IN the SELECT userName
The FROM yonghu
WHERE yonghu. YonghuID=jianlitoufang. YonghuID)


SQL is a bit messy, you help you organize,
The two tables of table structure under the cut a figure to see?

CodePudding user response:

Feel jianlitoufang. JianlitoufangID='" + num + "' there is a problem

CodePudding user response:

Generally is the issue of Chinese space
  • Related