당신은 set
데이터 유형을 사용하여 고려할 수 있습니다 : - 쿼리를 수행 할 때 http://dev.mysql.com/doc/refman/5.0/en/set.html
profile set ('newsletter', 'searchable', ....)
, 그것은 것입니다 : - 양자 택일
select ... from user
where find_in_set('searchable', profile)>0 and ...
, 당신은 각 프로파일을 정상화하기 위해 프로파일 테이블을 만들 수 있습니다 하나의 기록이 되십시오.
user (id, ...);
user_profile (user_id, profile_id, profile_value);
profile (id, name);
검색 : -
select ... from user
inner join user_profile on user.id=user_profile.user_id
inner join profile on profile.id=user_profile.profile_id
where profile.name='searchable' and user_profile.profile_value=1 ...
그런 다음 다 대다 관계를 사용한다는 의미입니다. 좋은 소리. – enchance