Home > database >  Ask a question about Group By sorting
Ask a question about Group By sorting

Time:10-04

Now the data is on my side


Id number item cata
1 C0001 2 null
2 C0001 1 a
3 C0001 3 null
4 C0002 1 a

The above data, I in the use of group by number of time, always can take to the Item for 2 cata data,

How can the group by, first, sorting item only take 1 value, cannot use the where the item=1 because there are some data, need to use group_concat show,

In addition to the sub queries sorted, is there any other way in the group by, great god give advice or comments, please. Thank you

CodePudding user response:

Ok, has been solved, with a GROUP BY NUMBER HAVING ITEM='1'

Who replies, "post

CodePudding user response:

pick up points

CodePudding user response:

Pick up points...

CodePudding user response:

Group by is cannot use the where only in combination with having to use,

CodePudding user response:

reference 1st floor stely881004 response:
well, has been solved, use the GROUP BY NUMBER HAVING ITEM='1'

Who respond to the junction post

CodePudding user response:

  • Related