undefinedfix
Sign in

How to design a key with multiple contents in MySQL

itoaf edited in Tue, 13 Sep 2022

For example, now there is a forum advertising system, advertising can be displayed in the set plate, plate has the corresponding plate ID. Now I want to publish an advertisement to show in the plates 1, 3, 4 and 5. How can I be more elegant?

Add a FID key in the advertisement table, content, 1,3,4,5, and use like '%, 1,%' when querying. This will cause some performance problems. Is there any other better plan

1 Replies
wpqwi
commented on Tue, 13 Sep 2022

find_ in_ set