Knowledge about SQL operations for MYSQL SET fields [php] <em> 'mark' set ('index', 'best', 'hot ') </em>, there are few people familiar with it. I have been searching for a long time. I finally got a set of knowledge points and looked at the above structure. MYSQL is not stupid. Will it store indexes? No, the number set field is saved using binary numbers to correspond to the values you SET one by one, such as index, which is placed in 0th bits, then the zero side of 2 is equal to 1 www.2cto.com [php] update from table SET mark = 1 [php] update from table SET mark = 'index'. The above two results are the same. Then the problem arises, just like zhimeng. If I want to add a popular article, but do not want to delete other identifiers, do it? Or I want to delete an identifier, I don't know what logo I used to have. The following is the addition of the logo [php] update from table SET mark = mark | 1 | 2 do not ask why I use it | this stuff, the above means to add the index, best two identifiers, if you only add a hot ID, write it as | 4. You can delete the ID [php] update from table SET mark = mark & ~ under www.2cto.com &~ 4 &~ 1. Let me talk about updates. The following describes how to query [php] SELECT * FROM table WHERE FIND_IN_SET ('hot ', mark), which is the simplest query method, you can also use the binary number 4 in the hot location to replace the query. The efficiency is the same. You can also write this statement: [php] SELECT * FROM table WHERE mark & 1 author longxuu