开发者

Is there a good alternative to bitwise comparison because there are too many options?

This is a problem I am trying to solve in Microsoft SQL server 2005.

I have a problem I am trying to solve where I have a list of records in table A- we'll call them plans. A user may be associated with one or more of these plans and that results in them being associated with a single record in Table B. This开发者_如何学Go could easily be solved with a bitwise and (&), however the datatype bigint only supports 2^63-1. I could save the values as a binary datatype, but you can't compare two binary columns (one has to be an int or bigint).

My question is: Is there another way to implement this I am not thinking about?


Yes. It's called a one-to-many relationship. Create a Plan table with a Foriegn Key (FK) back to the User table primary key.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜