I have a MySQL query like this:
SELECT *, SUM (.. Some SQL solutions have been removed.) Q as a few of the events of AS where the criterion = "value" group is ordered by q.P_id due to DESC limit 10;
I want to limit the results to rows where incidents> 0 it seems very simple to me, but I can not seem to work on it Whichever I try, WHERE or HAVINGS, whenever I try to add this restriction, I do not get a line in return. I am positive that the data in my table should be returned. Does anyone know what I'm doing to complete?
I have tried this, but it still does not work. Any ideas why it still will not work?
SELECT *, SUM (... has been removed for some SQL equivalents), such as when some_ exists, where the SQ where the criterion is being "value" is SUM (. Some SQUs have been removed for the cost.)> DESC limit 10 by the QP_ID order by the group; As I am with SQL Server but in T, I am not familiar with MySQL as,
-SUl, you can not use the nickname in the group by clause (I originally took the order according to the idea, but later it was incorrectly stated). In this case, you want to filter based on the results of a group BY, so I will use a HAVING block as follows:
SELECT *, SUM (... some SQL summaries Has been removed for ...) as some items coming from SQ where criterion = 'value' group is removed by q.P_id SUM (... for some summaries, SQL ...)> ; Order 10 according to the DESC events;
Comments
Post a Comment