0
It is necessary to compare data from the MYSQL database, but the data to be compared is not extremely equal. MYSQL LIKE does not work in this case because there are some variables in this query.
To illustrate
In the user table, you have the "cards" field.
The letters are inserted as below:
In the above template there are 3 cards inserted, but in the system there are more than 80 cards. And the levels range from 1 to 20
Then I need to compare with another table, which will not have 80 cards but 3, as below:
It should display which cards have a level less than or equal to the registered one. In the case of id 1201 and 1202 cards.
How to do this query using MYSQL?
Can I ask you a question, wouldn’t it be better to create relational tables by separating by "types of cards", "cards that people have" (this could include the level), "people"? I mean, that would make more sense the data relationship, using foreign keys, I can formulate a suggestion in the answer I’ve already made, I just need to know if this would suit you.
– Guilherme Nascimento