Yup here it is
Database error in vBulletin 4.0.2:
Invalid SQL:
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 1) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 1
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 2) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 2
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 3) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 3
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 4) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 4
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 5) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 5
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 7) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 7
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 8) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 8
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 9) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 9
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 10) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 10
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 11) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 11
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 12) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 12
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 13) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 13
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 14) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 14
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 15) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 15
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 16) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 16
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 17) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 17
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 18) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 18
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 19) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 19
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
)
UNION ALL
(
SELECT IFNULL(userid, 0) AS userid, IFNULL(typeid, 20) AS typeid, IFNULL(MAX(points), 0) AS points
FROM (
SELECT userid, typeid, SUM(points) AS points
FROM dbtech_vbactivity_pointslog
WHERE typeid = 20
GROUP BY userid
ORDER BY points DESC
) AS maxpoints
);
MySQL Error : Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
Error Number : 1140
Request Date : Monday, March 29th 2010 @ 12:53:04 PM
Error Date : Monday, March 29th 2010 @ 12:53:05 PM
Classname : vB_Database
MySQL Version : 5.0.45