Home > database >  IN the mysql IN the field of how to write the query itself is a comma
IN the mysql IN the field of how to write the query itself is a comma

Time:10-07

The data in the table is so of

Want 1 the results of the query result is shown in figure 2 data

Wrote IN mysql SQL statements can be found out, because I never wrote, so I think it is wrong: SELECT * FROM ` main_page_polly ` WHERE catagory IN (2, 3)

Great god to trouble about reason, if so write wrong words should be how to write the SQL

CodePudding user response:

It only seems to see the 2, 3 at the beginning of record, if 2 or 3 in the middle, can't see, can use the like to see, but performance is not good, wait for the optimal solution

CodePudding user response:

The REGEXP the realization of the regular group match, two strings
http://blog.csdn.net/acmain_chm/article/details/4141864

reference
recent view MySQL similar problems appear more, in the summary,



For some reason, sometimes we don't have, in accordance with the paradigm of design criteria and put some of the properties in the same string fields, such as personal interest, sometimes we design table for
The create table members (uid int primary key, uname varchar (20), hobby varchar (100));

Within the table...

CodePudding user response:

Similar like the REGEXP upstairs does not represent the whole is equal to if there is a similar result is wrong

CodePudding user response:

LZ is solved?
  • Related