Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6764659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:37:11+00:00 2026-05-26T14:37:11+00:00

I have the following query: SELECT wm_concat(DISTINCT NAME) as Methods FROM TPM_TRAININGPLAN JOIN TPM_DELIVERYMETHODS

  • 0

I have the following query:

SELECT wm_concat(DISTINCT NAME) as Methods FROM TPM_TRAININGPLAN
JOIN TPM_DELIVERYMETHODS USING (METHODID)
WHERE PROJECTID=735 AND VERSIONID=1
ORDER BY NAME

On our production database (some uber expensive Oracle SKU that costs more than my house *), it returns:

I/OLT,ILT-WEB,OLT,QRG

However, on my local Oracle Express instance (11g) which I use for development, I get the error:

>[Error] Script lines: 13-16 ------------------------
 ORA-00904: "WM_CONCAT": invalid identifier
 Script line 13, statement line 1, column 7

Does Oracle Express not support this, or is there a work-around (such as can I copy the function from our production server, or run some script to “mimic” it?) Thanks!

* No seriously it actually costs more than my house.

UPDATE:

As suggested, I tried the LISTAGG function (which is indeed included in both Express 11g and the “Shall we buy an Oracle license or a second yacht” SKU. This seems to almost work, but has a few drawbacks which I can’t find a good workaround for. First, the query:

SELECT LISTAGG(NAME, ',') WITHIN GROUP (ORDER BY NAME) Methods FROM
TPM_TRAININGPLAN
JOIN TPM_DELIVERYMETHODS USING (METHODID) WHERE PROJECTID=240 AND VERSIONID=1

Will return:

COMM,COMM,ILT-F2F,ILT-F2F,ILT-F2F,ILT-F2F,ILT-F2F

However, I want to remove the dupes. Changing NAME to DISTINCT NAME will throw the error DISTINCT option not allowed for this function

Well great, we’ll just toss a CTE in there:

WITH Methods AS
   (SELECT DISTINCT NAME
    FROM TPM_TRAININGPLAN
    JOIN TPM_DELIVERYMETHODS USING (METHODID) WHERE PROJECTID=240 AND VERSIONID=1)
SELECT LISTAGG(NAME, ',') WITHIN GROUP (ORDER BY NAME) Methods FROM Methods

This works, however I forgot to mention that I’m running this entire thing as a nested select in a larger query. It seems you can have nested selects that include a CTE, however within the query you can no longer refer to the root query, only the CTE. So now I can’t replace 240 and 1 with the appropriate values from the row I’m on.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:37:12+00:00Added an answer on May 26, 2026 at 2:37 pm

    if you are in 11GR2, you ought to be able to do listagg

    with fake_data as(
    
    select 'I/OLT' NAME , 1 aa from dual
    union all
    select 'ILT-WEB' NAME,2 from dual
    union all
    select 'OLT' NAME,3 from dual
    union all
    select 'QRG' NAME,4 from dual
    )
    SELECT 
           LISTAGG(NAME, ', ') WITHIN GROUP (ORDER BY name)  name_list
    FROM fake_data
    ;
    
    NAME_LIST                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
    --------------------------
    I/OLT, ILT-WEB, OLT, QRG  
    

    I don’t have Oracle Express 11Gr2 to test this (just enterprise).
    But Oracle Express does not have Java support, but you can try to implement it via custom types (once again I don’t have Express to test with!)
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:2196162600402

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following query: SELECT DISTINCT w.name, count(*) FROM widgets AS w JOIN
i have the following query SELECT DISTINCT dr.Revision FROM tblActionHeader ah INNER JOIN tblActionType
I have the following query: SELECT c.* FROM companies AS c JOIN users AS
I have the following query SELECT e.topicShortName, d.catalogFileID, e.topicID FROM catalog_topics a LEFT JOIN
I have the following query: SELECT COUNT(*) FROM FirstTable ft INNER JOIN SecondTable st
I have the following query: SELECT o.id,o.name FROM object o WHERE ( o.description LIKE
I have the following query SELECT * FROM attend RIGHT OUTER JOIN noattend ON
I have the following query: select * from ACADEMIC a left join RESIDENCY r
I have the following query: SELECT products_categories.categoryID, name, COUNT(*) AS itemCount FROM products_categories LEFT
I have the following query: SELECT `pokemon_moves`.`pokemon_move_method_id`, `pokemon_moves`.`level`, `move`.`id`, `move`.`name` FROM `pokemon_moves` LEFT OUTER

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.