我需要你帮我处理三张桌子之间的联系。我想在java中激发这段代码的灵感。
ResultSet resu = ConnexionMySQL.getInstance().selectQuery (req);
try {
while (resu.next())
{
myList.add (new Collabo(resu.getInt("IdOrg"),
new Album(resu.getString("CodeA"), resu.getString("TitreA"),
new Chanteur (resu.getInt("IdentC"),resu.getString("IdentC")),
resu.getDate("DateArrivee"))));
}
}
我只知道现在要连接两张桌子
Select IdOrg, A.CodeA
from collabo A, album C
where A.CodeA = C.CodeA order by 1
发布于 2018-05-31 17:34:38
SELECT c.IdOrg, a.CodeA, ch.NomC
FROM album a
LEFT JOIN collabo c ON a.CodeA = c.CodeA
LEFT JOIN chanteur ch ON a.IdentC = ch.IdentC
ORDER BY a.CodeA
https://stackoverflow.com/questions/50620740
复制相似问题