mysql group by grouping problem.

WBOY
Release: 2016-10-10 11:55:56
Original
1237 people have browsed it

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>
Copy after login

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...

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!