Home > database >  Has been submitted to the not group by expression.. To solve the
Has been submitted to the not group by expression.. To solve the

Time:09-28

CodePudding user response:

Has been submitted to the not group by expression

CodePudding user response:

==, upload the wrong

CodePudding user response:

CodePudding user response:

Set of functions outside the count field, all want to be in the group by clause

CodePudding user response:

You'll have to look at the group by the use of the ah, query fields besides the function of behind the group by

CodePudding user response:

This,,,,, so difficult ah,,,,,,, I don't see other similar application will count outside above in the field

CodePudding user response:

Is all the table fields? Or a table field?

CodePudding user response:

The count, regardless of ab

CodePudding user response:

Select those of non-cohesive fields, are written in the group by;

PS: mysql to don't write, but the data is not stable;

CodePudding user response:

But the whole group by, the original data structure was altered

CodePudding user response:

references 9 f wmxcn2000 response:
select in the non-cohesive fields, are written in the group by;

PS: mysql to don't write, but the data is not stable;
whole group by words, however, the original data structure was altered

CodePudding user response:

The first field is wrong, b.i d to Anderson, d, and in addition to the count (a. d. ocno) on the group by other fields

CodePudding user response:

What is the purpose of your group by Anderson, d the?

CodePudding user response:

The
reference 13 floor wmxcn2000 reply:
you group by Anderson d what is the purpose of the?
no, that was just a style, if really want to above, the original without groupby data structure is changed,,

CodePudding user response:

You might as well put the raw data and expected results of post;

CodePudding user response:

reference 15 floor wmxcn2000 response:
you might as well put the raw data and expected results of post;
should not be 1, 1, it should be 4, 2, docno is the receipt number, my count (a. d. ocno) is the corresponding number

CodePudding user response:

reference 16 floor qq_34711895 response:
Quote: reference 15 floor wmxcn2000 response:

You might as well put the raw data and expected results of post;
should not be 1, 1, it should be 4, 2, docno is the receipt number, my count (a. d. ocno) is the corresponding number


You this how grouping, grouped under what conditions, a Group By is not good, do you have in this post, if only documentary, according to the number of
Directly Select Count (1), document Numbers From the Table Group by document number.
Behind this, if there are other fields, at the back of the receipt number add:
Select Count (1), document number, Colunm1, Colunm2 Colunm3... From Table Group by document number, Colunm1, Colunm2 Colunm3... ;

CodePudding user response:

The subquery can do to meet demand

The select a. d. ocno
.
from .. - the original query you
(select docno, count (docno) from m_retail group by docno) tt - plus the subquery
Where a. d. ocno=tt. Docno -- -- through the docno association

CodePudding user response:

Let's look at the group by usage

CodePudding user response:

In addition to the mysql database I have ever seen in using the group by clause, behind the select have requirements:
Either the field is the group by the back of the
These fields are either aggregation function (the count, Max, min, avg) calculated the results

CodePudding user response:

1, all written into group by
Necessary condition for the 2, group by, in the subquery, then link
3, the count () over (partition) by specific syntax for baidu

CodePudding user response:

Regular Sql syntax: outside of the aggregation function all fields must be behind the gp,,
Except the mysql database,

CodePudding user response:

Grammar is wrong, must put behind you select fields to join groupby behind

CodePudding user response:

It no matter what you have to select at least group by come out, you group by Anderson, d you select Anderson, d

CodePudding user response:

Maybe you used to the MYSQL database, this can be in MYSQL, but not ORACLE, after the GROUP BY field, SELECT the fields that must appear after the GROUP BY, unless the statistical functions,

CodePudding user response:

In addition to group the count () function inside the field, all want to be in the group by clause in it is necessary condition

CodePudding user response:

Correlation and cartesian set

CodePudding user response:

You'll have to look at the group by the use of the ah, query fields besides the function of behind the group by
  • Related