如何显示基于空格,逗号,点等的分隔单词列表。通过选择查询在列中作为句子... [英] How to show list of separated word based on space, comma, dot etc. That is in a column as sentence through select query...

查看:50
本文介绍了如何显示基于空格,逗号,点等的分隔单词列表。通过选择查询在列中作为句子...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想生成一个单词列表作为建议,根据空格,逗号,点或来自sql server中特定表的列的任何其他特殊符号进行拆分。



示例 -



单列值显示在这里 -



I wanna generate a words list as suggestion that is splited based on Space, Comma, dot or any other special symbols from a particular Column of table in sql server.

Example -

Single Column Value show here -

Preferred Medicine
-------------------
Abacavir Sulfate, Abarelix, Abatacept, Abciximab.
Cabergoline  Caduet Cafcit Cafergot, Caffeine Citrate
Nabi-HB, Nabumetone, Nadolol







结果应该是这样的 -






Result Should be like this -

Medicine Name
-------------------
Abacavir
Sulfate
Abarelix
Abatacept
Abciximab
Cabergoline
Caduet 
Cafcit 
Cafergot
Caffeine 
Citrate
Nabi-HB
Nabumetone
Nadolol





所以它会如何..请给出你的建议..



我尝试过的事情:



我不明白怎么能这样做所以请



尽快给我你的答案..



提前感谢



so how it will be .. pls gives ur suggestions..

What I have tried:

I did not understand how can i do this so please

give me yours answer as soon as possible ..

thanks in advance

推荐答案

如果这是你的SQL数据,那么这是一个糟糕的数据设计,你应该考虑改变它。

这是你在这个设计中遇到的问题中最少的一个,它的 仍然 复杂工作!

见这里:将列中的逗号分隔数据转换为行以供选择 [ ^ ]你会明白为什么它很复杂。

单身每行的价值解决方案更容易使用。
If that's your SQL data, then it's a poor data design, and your should consider changing it.
This is the least of the problems you will have with this design, and it's still complex to work round!
See here: Converting comma separated data in a column to rows for selection[^] and you'll get an idea why it's complicated.
A "single value per row" solution is much easier to work with.


这篇关于如何显示基于空格,逗号,点等的分隔单词列表。通过选择查询在列中作为句子...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆