top of page

LISTAGG in PLSQL

Writer's picture: Rumesh Aponso (RMAX)Rumesh Aponso (RMAX)

Example 1:

SELECT DISTINCT LISTAGG(t.commission_receiver, ';') WITHIN GROUP (ORDER BY t.commission_receiver) FROM order_line_commission_tab t;

Example 2:

SELECT LISTAGG(product_name, '; ') WITHIN GROUP (ORDER BY product_name DESC) "Product_Listing"
FROM   products;

Example 3:

SELECT RTRIM(XMLAGG(XMLELEMENT(e, text, ',').EXTRACT('//text()')).GetClobVal(),',') very_long_text
FROM   (SELECT TO_CHAR(TO_DATE(level, 'j'), 'jsp') text FROM DUAL CONNECT BY LEVEL < 250);

Related Links:


2 views0 comments

Related Posts

See All

Fnd Dynamic Tab Page in IEE Client

[FndWindowRegistration("YVVDA_COMPANY_ADDR", "YvvdaCompanyAddr", FndWindowRegistrationFlags.HomePage)] [FndDynamicTabPage("frmCompanyAddr...

Get Foundation Error from ORA Error

FUNCTION Strip_Ora_Error ( sqlerrm_        IN VARCHAR2,    sqlcode_        IN NUMBER DEFAULT NULL,    strip_ora_only_ IN BOOLEAN DEFAULT...

Comments


Copyright © 2025 RMAXOneNote

  • Online CV
  • LinkedIn
  • Youtube
  • GitHub
  • Blogger
bottom of page