如何在一列中插入多个选定的复选框值 [英] How to insert Multiple selected checkbox values in one column
问题描述
我想在 MS Sql server 2005/08 的一列中插入多个选中的复选框值例如.复选框是:
i want to insert multiple selected checkbox value in one colunm in MS Sql server 2005/08 Eg. checkboxes are:
板球足球绘画
表结构如:
Id | name | Hobbies
----|----------|--------------------------
1 | Atish | cricket,football,painting
2 | Swapnil | football, painting
你能帮我吗?
推荐答案
有一种叫做第三范式的东西:使用它:)
There is something called the third normal form: use it :)
这对您来说基本上意味着,您需要将爱好与该表分开,创建一个包含可能的爱好的单独表,并在人员和爱好之间创建一个查找表.
Basically this means for you, you need to separate the hobbies from that table, create a seperate table with the possible hobbies and create a lookup-table between the people and the hobbies.
肮脏的方法是定义一个分隔符并将像 cricktet|football|painting 这样的东西插入到列中:但我真的不建议这样做!
The dirty way would be to define a seperator and insert smth like cricktet|football|painting to the column: but I would really not suggest to do that!
这篇关于如何在一列中插入多个选定的复选框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!