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-この質問への答えは** Absolutly yes!** –
@ZoharPeled OPはデータベースの設計に責任を負いませんが、それは事実です。 –