0
我有以下查詢:反向engneering查詢
SELECT a.catalogID, d.catalogFileID, e.catalogFileID
FROM catalog_topics a
LEFT JOIN catalog_files_join b ON a.catalogID = b.foreignKey
LEFT JOIN catalog_files_join c ON c.foreignKey = b.catalogFileID
LEFT JOIN catalog_files d ON d.catalogFileID = c.catalogFileID
LEFT JOIN catalog_files e ON e.catalogFileID = b.catalogFileID
WHERE b.fileTypeID = 'gvl401'
AND c.fileTypeID = 'gvl25'
AND a.topicID = 'top312'
ORDER BY a.sortOrder;
返回以下結果:
88 cfil923 cfil922
89 cfil925 cfil924
91 cfil929 cfil928
171 cfil107 cfil1074
我想寫一個INSERT語句來插入一些記錄這樣一種方式,如果我插入2記錄上面的select查詢返回6條記錄。插入時,我將有權訪問上面where子句中的所有內容,並且我將插入新的d.catalogFileID和e.catalogFileID。