我想在SQL Server上返回每个由斜杠分解的字符串的日期。从SQL Server的某些列中展开值的返回日期
我的数据库表:
id | date | col1 | col2 | col3 | col4
---+------------+-------------+-----------+-------+------------
1 | 2017-04-02 | /txt1/txt2 | | |
2 | 2017-04-03 | | /txt1/txt4| |
3 | 2017-04-04 | |/txt2/txt3 | |
4 | 2017-04-05 | |/txt4 | |/txt5/txt6
结果想:
2017-04-02 txt1
2017-04-02 txt2
2017-04-03 txt1
2017-04-03 txt4
2017-04-04 txt2
2017-04-04 txt3
2017-04-05 txt4
2017-04-05 txt5
2017-04-05 txt6
谢谢 皮埃尔
那么,你为什么不跟我们分享你到目前为止试过吗? –
阅读[在数据库列中存储分隔列表真的不好吗?](http://stackoverflow.com/questions/3653462/is-storing-a-delimited-list-in-a-database-column-really-那么你会看到很多原因,为什么这个问题的答案是**绝对是!** –
@ZoharPeled它可以是这种情况,但OP不负责数据库的设计。 –