【发布时间】:2015-12-04 15:55:57
【问题描述】:
ID 序列号日期文本
CD1 1 12/1/2015 HELLO HO
CD1 2 12/1/2015 --W ARE YOU
CD1 3 12/1/2015 --? received an account recovery
CD1 4 12/1/2015 --request on
CD1 5 12/1/2015 -- Stack
CD1 6 12/1/2015 -- Overflow.
CD1 7 12/2/2015 This email address is
CD1 8 12/2/2015 ---associated with
CD1 9 12/2/2015 --an account, but
CD1 10 12/2/2015 ---no password is associated.
CD1 11 12/3/2015 As a reminder, you
CD1 12 12/3/2015 --can use any of the following credentials.
CD1 13 12/3/2015 once logged in, you can review existing credentials.
CD1 14 12/3/2015 If you did not initiate this account recovery reque
CD1 15 12/3/2015 --st, just ignore this email
Required Answer:
ID SEQNO DATE TEXT
CD1 1 12/1/2015 HELLO HOW ARE YOU.? received an account recovery request on StackOverflow.
CD1 7 12/2/2015 This email address is associated with an account, but no password is associated.
CD1 11 12/3/2015 As a reminder, you can use any of the following credentials.
CD1 13 12/3/2015 once logged in, you can review existing credentials.
CD1 14 12/3/2015 If you did not initiate this account recovery request, just ignore this email
代码?您能帮我使用 plsql 或 sql 将“--”记录与“非--”记录合并吗?
【问题讨论】:
-
你试过什么?在我的脑海中,我首先将行分组(可能通过使用类似
last_value(case when text like ' --%' then null else seq_no end ignore nulls)分析函数的东西)以获得组号,然后根据先前派生的组号对结果行进行 listagg 。自己尝试一下,如果遇到困难,我们很乐意为您提供帮助。 -
我试过 listagg 和 wm_concat 但事情是 2015 年 12 月 3 日,所有记录都合并为一条记录。
-
CD1 11 12/3/2015 作为提醒,您可以使用以下任何凭据。登录后,您可以查看现有凭据。如果您没有发起此帐户恢复请求,请忽略此电子邮件
-
Siyual:感谢 L.as 的建议
-
Boneist : 非常感谢您的帮助 感谢 Boneist。
标签: sql oracle plsql oracle-sqldeveloper plsqldeveloper