您好,我在 C# 中的这个查询上有一个语法错误,我不知道是什么原因造成的,当我在 Microsoft SQL Server 2012 中查询它时,我只是按预期获取数据,谁能帮助我:
SqlConnection connectie = new SqlConnection("user id=;" +
"password=;server=;" +
"Trusted_Connection=false;" +
"database=; ");
SqlCommand statsDocenten = new SqlCommand("SELECT enquete_vraag as vraag,AVG(enquete_antwoord_radio) as gemiddelde_antwoord,docent,vak" +
"FROM ENQUETE_ANTWOORD " +
"LEFT JOIN KDV " +
"ON ENQUETE_ANTWOORD.kdv_ID = KDV.kdv_ID " +
"LEFT JOIN DOCENT " +
"ON KDV.docent_ID = DOCENT.docent_ID " +
"LEFT JOIN VAK " +
"ON KDV.vak_ID = VAK.vak_ID " +
"LEFT JOIN ENQUETE_VRAAG " +
"ON ENQUETE_ANTWOORD.enquete_vraag_ID = ENQUETE_VRAAG.enquete_vraag_ID " +
"WHERE DOCENT.docent_ID = " + docentid + " AND VAK.vak = " + vak + " AND ENQUETE_ANTWOORD.enquete_antwoord_radio != '' " +
"GROUP BY enquete_vraag,enquete_antwoord_radio,docent,vak", connectie);
我已经在“可能已经有你答案的问题”区域检查了一堆问题,但我不知道哪个问题和答案会影响我的查询。