成人AV在线无码|婷婷五月激情色,|伊人加勒比二三四区|国产一区激情都市|亚洲AV无码电影|日av韩av无码|天堂在线亚洲Av|无码一区二区影院|成人无码毛片AV|超碰在线看中文字幕

oracle一行拆成多行 如何將oracle中一條數(shù)據(jù)拆分成多條?

如何將oracle中一條數(shù)據(jù)拆分成多條?例如表名為test,數(shù)據(jù)如下原數(shù)據(jù)為col1 col2 col3 col4A 1 2 3B 1 2 3然后用如下語句select * from(select c

如何將oracle中一條數(shù)據(jù)拆分成多條?

例如表名為test,數(shù)據(jù)如下

原數(shù)據(jù)為

col1 col2 col3 col4

A 1 2 3

B 1 2 3

然后用如下語句

select * from

(select col1,col2 from test

union all

select col1,col3 from test

union all

select col1,col4 from test) as t

order by col1

得到的數(shù)據(jù)就是

A 1

A 2

A 3

B 1

B 2

B 3

oracle如何將一個字段由逗號分割成多行?

select sum(列),sum(decode(列,null,1,0))from table

如何拆分字段字符串為多行顯示?

--首先,你是按什么規(guī)則拆? 我舉個例子 你要按字段中的逗號拆開,假設(shè)字段名叫text

--用charindex和substring這2個函數(shù)

select substring(text,1,charindex(",",text)-1) as [before], substring(text,charindex(",",text),len(text)) as [after] from table

oracle如何將一個字段內(nèi)容拆分多行顯示?

1 臨時表2 拆分字符串3 按逗號順序塞進(jìn)臨時表不懂 plsql,所以只能提供個思路。如果你會 xml,或許先將代都好的字符串轉(zhuǎn)成 xml,再轉(zhuǎn)表會更好做