SQL FIND_IN_SET () determines whether there is a number in a data table to the data fields separated by commas

Field stores the data in the table, the comma-separated string , for example, (1,2,6,8)

I did not know this usage, such as encountered string 8 which is included in the change can be taken out one by one, and then parsed into an array, and then determines whether the array, the efficiency is very low;

FIND_IN_SET(str,strList)

  • To query string str
  • strList field names, parameter "," separated, such as (1,2,6,8)

 

Now, with this, directly where FIND_IN_SET (8, data table field name), you can.

Guess you like

Origin www.cnblogs.com/pyspang/p/11403025.html
Recommended