如何在SQL Server中用semocolen分割存储在表中的数据? [英] Howto split a data stored in a table with semocolen in SQL server?
本文介绍了如何在SQL Server中用semocolen分割存储在表中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何拆分存储在Sql server中的表中的数据?
我想用分号拆分存储在表中的数据,然后将其插入临时表,然后根据数据进行过滤分开。
我尝试了什么:
我想拆分用分号存储在表中的数据,然后将其插入临时表,然后根据数据拆分进行过滤。
Howto split a data stored in a table in Sql server?
I want to split the data stored in table with semicolon and then insert the same to a temporary table and then filter based on the data split.
What I have tried:
I want to split the data stored in table with semicolon and then insert the same to a temporary table and then filter based on the data split.
推荐答案
通常将数据存储在DB表中,'分开不是一个好习惯。它不符合规范化规则。没关系 。现在,解决方案是
generally store data in DB table with ',' separated is not a good practice. it's not follow normalization rule. it's ok . now, solution is
select * from tbl (','+ RTRIM(tblcolumn) +',') like '%,'+ condition +'
这篇关于如何在SQL Server中用semocolen分割存储在表中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文