Home  >  Article  >  Backend Development  >  mysql group by grouping problem.

mysql group by grouping problem.

WBOY
WBOYOriginal
2016-10-10 11:55:561234browse

mysql group by grouping problem.

As shown in the picture, want to split the data in the number field by commas and then group it?
For example, there may be only 3 pictures with content 12, and 1 picture with content 123. Seeking a master online (disregarding table splitting and other storage methods for grouping)

Reply content:

mysql group by grouping problem.

As shown in the picture, want to split the data in the number field by commas and then group it?
For example, there may be only 3 pictures with content 12, and 1 picture with content 123. Seeking a master online (disregarding table splitting and other storage methods for grouping)

mysql has a function: find_in_set. The specific usage is as follows:

<code>select id from table where FIND_IN_SET('12',number);
</code>

The above sentence can extract the ID set with number 12.

I looked at the find_in_set upstairs, but I haven’t used it before. I found this article, which is very well written:
https://segmentfault.com/a/11...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn