C # Unified query for Batch table Wm_concat rows and columns conversion row count

Source: Internet
Author: User


Columns that need to be displayed
sql = string. Format (@ "
SELECT Wm_concat (COL. COLUMN_NAME)
From User_tab_cols COL
WHERE COL. table_name = ' {0} '
", fromtable);
String col = "" + DAC. ExecuteScalar (CommandType.Text, SQL);
Get data that has been imported
sql = string. Format (@ "SELECT {2}
from {0}
WHERE SUBSTR (SRQ, 1, 5) | | Case INSTR (SUBSTR (SRQ, 6, 2), '-')
When 2 Then
' 0 ' | | REPLACE (SUBSTR (SRQ, 6, 2), '-', ')
ELSE
SUBSTR (SRQ, 6, 2)
END = ' {1} '
ORDER by To_number (SBH, ' 999999 ') ", toTable, Periodcode, col
);

DataTable dt = DAC. executedatatable (SQL);

C # Unified query for Batch table Wm_concat rows and columns conversion row count

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.