我想获得以下结果:
{'myExamPackages': [ { id: 1, examName: 'AWS Developer Associate Exam
Package', examDescription: 'Looking', price: 15,
examimage: "aws.png", category: "AWS", myExam: [63, 64] }]}
我必须遵循两个我想要汇总的问题。
此语句将返回您已购买的考试的ExamPackageID,以便
SELECT BoughtPackage.ExamPackageexamID as 'id',
ExamPackage.examName,
ExamPackage.examDescription,
ExamPackage.price,
ExamPackage.examimage,
ExamPackage.category,
ExamPackage.topics,
ExamPackage.numberOfTests
FROM CloudExams.`Order`
JOIN BoughtPackage
ON CloudExams.`Order`.orderID = CloudExams.BoughtPackage.orderID
JOIN ExamPackage
ON BoughtPackage.ExamPackageexamID = ExamPackage.examID
WHERE userID = ?
此语句返回以下myExam数组:
SELECT myTest.myTestID
FROM myTest
JOIN Test
ON myTest.testID = Test.testID
JOIN ExamPackage
ON Test.examID = ExamPackage.examID
WHERE ExamPackage.examID = ?
AND myTest.userId = ?
我很确定有办法做到但却看不到它。任何帮助,将不胜感激。
由于