gpt4 book ai didi

mysql - 删除由WITH ROLLUP引起的第二行

转载 作者:行者123 更新时间:2023-11-30 01:22:03 25 4
gpt4 key购买 nike

我需要删除第二行结果,其中包含第一行总记录的重复项。我的结果集如下

1 | 1025

1 | NULL --- 我需要删除这一行

我的查询如下:

SELECT SUM( mdl_quiz.fcpd ) AS cpdtotal, mdl_user.id AS userid
FROM mdl_grade_grades
INNER JOIN mdl_user ON mdl_grade_grades.userid = mdl_user.id
INNER JOIN mdl_grade_items ON mdl_grade_grades.itemid = mdl_grade_items.id
INNER JOIN mdl_quiz ON mdl_grade_items.itemname = mdl_quiz.name
INNER JOIN mdl_course ON mdl_grade_items.courseid = mdl_course.id
INNER JOIN mdl_user_info_data ON mdl_user.id = mdl_user_info_data.userid
WHERE mdl_user_info_data.fieldid =1
AND mdl_grade_items.itemname IS NOT NULL
AND mdl_user.annualCPDReportActive = 'Y'
AND (
mdl_course.category =27
)
AND mdl_user.id =1025
AND YEAR( FROM_UNIXTIME( mdl_grade_grades.timemodified ) ) =2013
GROUP BY mdl_user.id
WITH ROLLUP

最佳答案

您应该删除WITH ROLLUP更多信息here .

关于mysql - 删除由WITH ROLLUP引起的第二行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18427399/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com