0
你好。我剛剛學會了如何選擇所有相關的數據,比方說,行 tennismatch.ID = 1:
SELECT * FROM tennismatch m
JOIN tennismatch_tennisset ms
ON m.`ID` = ms.`TennisMatch_ID`
JOIN tennisset s
ON ms.`mapOfSets_ID` = s.`ID`
JOIN tennisset_game sg
ON s.`ID` = sg.`TennisSet_ID`
JOIN game g
ON sg.`gamesMap_ID` = g.`ID`
JOIN game_point gp
ON g.`ID` =gp.`Game_ID`
JOIN point p
ON gp.`points_ID` = p.`ID`
WHERE m.`ID` = 1
,但我想不出如何刪除這一切。 非常感謝提前。
不能刪除或更新父行,外鍵約束失敗('tennis_scores'.'tennismatch_tennisset',約束'FK_TENNISMATCH_TENNISSET_TennisMatch_ID'外鍵('TennisMatch_ID')參考' tennismatch'('ID')) –
我可以,因爲,禁用外鍵檢查。 –