Home  >  Article  >  Backend Development  >  Requirement: How to find users with similar tags to yourself

Requirement: How to find users with similar tags to yourself

WBOY
WBOYOriginal
2016-09-05 08:44:481017browse

Now we are going to make a "guess what you like function". The rules are as follows:
Find people with similar tags to yourself.
The tag field in the database is like this. The tag id is stored, separated by commas (1,2,3 ,4):
Assume that I am 1, 5:
Then I need to find out the labels 1 - 5 -1, 5 -1, 6 -2, 5, 8 (- is the separator)

What if I write a sql statement?

The database is mysql

Requirement: How to find users with similar tags to yourself

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