Complete row-Forwarding with Oracle RowNum one case

Source: Internet
Author: User

First, the demand background:

Table A:

CREATE TABLE T_SMCOMMONMSG (
FXH NUMBER,
FTYPE NUMBER,
FMSG_CONTENT VARCHAR2(1024 BYTE)

Table B:

CREATE TABLE T_SMYL_COMMONSND (
FXH NUMBER,
FMSG_CONTENT1 VARCHAR2(1024 BYTE),
FMSG_CONTENT2 VARCHAR2(1024 BYTE)

The original records in Table A are as follows:

FXH FTYPE FMSG_CONTENT
------ -------- --------------
98 0 msg1
99 0 msg2
100 0 msg3
101 0 msg4

The existing records in table B are as follows:

FXH FMSG_CONTENT1 FMSG_CONTENT2
------- ---------------- --------------
1 空 空
2 空 空

Requirements: You are now required to convert the records in table A to the records in Table B, in the following format:

FXH FMSG_CONTENT1 FMSG_CONTENT2
------ ---------------- --------------
1 msg1    msg2
2 msg3    msg4

Note: Table A is a table of information containing a variety of ftype types, where the ftype=0 information is the original information of the conversion, with the sequence number starting at 98

Table B is a table of information that contains a ftype type, and its ordinal number starts at 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.