单元格内的 SQL 数组
我有一个单元格,其中包含由逗号分隔的字符数组,即“1,2,3,4,5”我的问题是,是否可以删除数组的特定元素,例如我想删除“1”那么单元格将变成“2,3,4,5”或删除“3”,它就会变成“1,2,4,5”我想在 SQL 中作为函数或存储过程执行此任务,任何非常感谢您的帮助。
I have a cell that contains an array of characters seperated by commas i.e. "1,2,3,4,5" My question is, is it possible to remove a particular element of the array such as if I wanted to remove "1" then the cell would then become "2,3,4,5" or remove "3" and it becomes "1,2,4,5" I want to perform this task within SQL either as a function or a stored procedure, any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然,这只是一些基本的字符串 REPLACE() 调用: http:// msdn.microsoft.com/en-us/library/ms186862.aspx
但是,由于您必须与该字段的其余部分分开操作该数据字段的各个位,因此它是获取规范化到它自己的子表中。
Sure, it'd just be some basic string REPLACE() calls: http://msdn.microsoft.com/en-us/library/ms186862.aspx
However, since you have to manipulate individual bits of this data field separately from the rest of the field, it's a good candidate for getting normalized into its own child table.