sql: select 行有多行数据
sql: select rows with multiple lines of data
在table A
-> Column X
中有一些包含数字、字母和特殊字符的数据。大多数记录只有一行数据,但也有一些记录有 2 或 3 行数据。
1 this is a sample description of data 01/11/2017 @ 123'~
记录两行数据
1 this is a sample description
2 of data 22/11/2017 @~ 12@#'
我需要做一个 select 查询来获取在 table A 的 X 列中有 2 行数据的记录。
我用的是TOAD
,上面提到的示例数据来自Grid popup editor
谢谢
您可以 select 那些包含新行的行(不知道您的示例数据,chr(10)
或 chr(13)
):
select *
from tableA
where instr(columnX, chr(10)) > 0;
方案摘自this SO answer,如果对您有帮助,请不要忘记点赞
在table A
-> Column X
中有一些包含数字、字母和特殊字符的数据。大多数记录只有一行数据,但也有一些记录有 2 或 3 行数据。
1 this is a sample description of data 01/11/2017 @ 123'~
记录两行数据
1 this is a sample description
2 of data 22/11/2017 @~ 12@#'
我需要做一个 select 查询来获取在 table A 的 X 列中有 2 行数据的记录。
我用的是TOAD
,上面提到的示例数据来自Grid popup editor
谢谢
您可以 select 那些包含新行的行(不知道您的示例数据,chr(10)
或 chr(13)
):
select *
from tableA
where instr(columnX, chr(10)) > 0;
方案摘自this SO answer,如果对您有帮助,请不要忘记点赞