如何在sql中连接单个单元格的多个值

时间:2020-12-30 07:56:50

i have a table in database like this

我在这样的数据库中有一个表

 column1      |  column2
 -------------+---------
 one two      |  three50 
 four , five  |  six30

I am looking for a select query who can fetch result like

我正在寻找一个可以获取结果的选择查询

onetwothree
forfivesix

1 个解决方案

#1


2  

Try this in Oracle:

在Oracle中试试这个:

SELECT regexp_replace(column1, '[ ,]+$','') 
FROM table

In SQL Server/MySQL/Sybase/even Oracle use:

在SQL Server / MySQL / Sybase /甚至Oracle中使用:

SELECT REPLACE(REPLACE(column1, "," , ""), " ", "")
FROM table

#1


2  

Try this in Oracle:

在Oracle中试试这个:

SELECT regexp_replace(column1, '[ ,]+$','') 
FROM table

In SQL Server/MySQL/Sybase/even Oracle use:

在SQL Server / MySQL / Sybase /甚至Oracle中使用:

SELECT REPLACE(REPLACE(column1, "," , ""), " ", "")
FROM table