Giter Club home page Giter Club logo

gauge-support's People

Contributors

evilrenegade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

number0

gauge-support's Issues

Error #1111: Invalid use of group function for the query

Thank you for this nice plugin! I added it to my mantis. But unfortunately, I cannot creat the gauge data.

in issue_ranking.php, the query

$dbquery = "SELECT
max(sd.bugid) as bugid,
count(sd.rating) as no_of_ratings,
sum(sd.rating) as sum_of_ratings,
avg(sd.rating) as avg_rating,
max(sd.rating) as highest_rating,
min(sd.rating) as lowest_rating,
IFNULL(bm2_count,0) AS bm2_count,
IFNULL(bm2_sum,0) AS bm2_sum,
IFNULL(bm1_count,0) AS bm1_count,
IFNULL(bm1_sum,0) AS bm1_sum,
IFNULL(b2_count,0) AS b2_count,
IFNULL(b2_sum,0) AS b2_sum,
IFNULL(b1_count,0) AS b1_count,
IFNULL(b1_sum,0) AS b1_sum
FROM {$plugin_table} sd
INNER JOIN {$bug_table} b ON sd.bugid = b.id
LEFT OUTER JOIN (SELECT bugid, count(rating) as bm2_count, sum(rating) as bm2_sum FROM {$plugin_table} GROUP BY bugid, rating HAVING rating = -2) bm2 ON sd.bugid = bm2.bugid
LEFT OUTER JOIN (SELECT bugid, count(rating) as bm1_count, sum(rating) as bm1_sum FROM {$plugin_table} GROUP BY bugid, rating HAVING rating = -1) bm1 ON sd.bugid = bm1.bugid
LEFT OUTER JOIN (SELECT bugid, count(rating) as b2_count, sum(rating) as b2_sum FROM {$plugin_table} GROUP BY bugid, rating HAVING rating = 2) b2 ON sd.bugid = b2.bugid
LEFT OUTER JOIN (SELECT bugid, count(rating) as b1_count, sum(rating) as b1_sum FROM {$plugin_table} GROUP BY bugid, rating HAVING rating = 1) b1 ON sd.bugid = b1.bugid
{$where_clause}
GROUP BY sd.bugid
ORDER BY sum(sd.rating) {$order}
LIMIT {$start}{$noOfBugs}";

results in the error "Database query failed. Error received from database was #1054: Unknown column 'rating' in 'having clause' for the query".

When I add the column "rating", I still get an other error. New query:

$dbquery = "SELECT
max(sd.bugid) as bugid,
count(sd.rating) as no_of_ratings,
sum(sd.rating) as sum_of_ratings,
avg(sd.rating) as avg_rating,
max(sd.rating) as highest_rating,
min(sd.rating) as lowest_rating,
IFNULL(bm2_count,0) AS bm2_count,
IFNULL(bm2_sum,0) AS bm2_sum,
IFNULL(bm1_count,0) AS bm1_count,
IFNULL(bm1_sum,0) AS bm1_sum,
IFNULL(b2_count,0) AS b2_count,
IFNULL(b2_sum,0) AS b2_sum,
IFNULL(b1_count,0) AS b1_count,
IFNULL(b1_sum,0) AS b1_sum
FROM {$plugin_table} sd
INNER JOIN {$bug_table} b ON sd.bugid = b.id
LEFT OUTER JOIN (SELECT bugid, rating, count(rating) as bm2_count, sum(rating) as bm2_sum FROM {$plugin_table} GROUP BY bugid, rating HAVING rating = -2) bm2 ON sd.bugid = bm2.bugid
LEFT OUTER JOIN (SELECT bugid, rating, count(rating) as bm1_count, sum(rating) as bm1_sum FROM {$plugin_table} GROUP BY bugid, rating HAVING rating = -1) bm1 ON sd.bugid = bm1.bugid
LEFT OUTER JOIN (SELECT bugid, rating, count(rating) as b2_count, sum(rating) as b2_sum FROM {$plugin_table} GROUP BY bugid, rating HAVING rating = 2) b2 ON sd.bugid = b2.bugid
LEFT OUTER JOIN (SELECT bugid, rating, count(rating) as b1_count, sum(rating) as b1_sum FROM {$plugin_table} GROUP BY bugid, rating HAVING rating = 1) b1 ON sd.bugid = b1.bugid
{$where_clause}
GROUP BY sd.bugid
ORDER BY sum(sd.rating) {$order}
LIMIT {$start}{$noOfBugs}";

New Error: "Database query failed. Error received from database was #1111: Invalid use of group function for the query"

Any suggestion?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.