Forum Stats

  • 3,728,544 Users
  • 2,245,649 Discussions
  • 7,853,590 Comments

Discussions

cancel

User_AC3QE
User_AC3QE Member Posts: 28 Red Ribbon
edited April 13 in SQL & PL/SQL

Answers

  • Frank Kulash
    Frank Kulash Member, Moderator Posts: 40,322 Red Diamond
    edited April 12

    Hi,

    Thanks for posting the CREATE TABLE and INSERT statements. The CREATE TABLE statement doesn't work; there's no table name. Is is supposed to be CREATE TABLE die_nr_atend ... ?

    It's unclear what you want to do. If you want a string containing a comma-delimited list of values, the LISTAGG function may do what you want. LISTAGG changed in version 19; in earlier versions it didn't have a UNIQUE option. What version of Oracle are you using?

    because afterwards I will relate to another table to know another specific field.

    Using LISTAGG results to join to another table isn't a good idea. Use a join or perhaps an IN sub-query instead. If you'd like help, post CREATE TABLE and INSERT statements for the other table, the exact results you want from both tables and an explanation of how you get those results from those tables. If the results depend on parameters passed a run-time, post a couple of different sets of parameters, and the exact results you want from each set, given the same sample data.

  • Frank Kulash
    Frank Kulash Member, Moderator Posts: 40,322 Red Diamond

    Hi,

    Sorry, there was mistake in my earlier reply. I meant to say

    Using LISTAGG results to join to another table isn't a good idea.

    but the last part was missing. However, there was no mistake in the section starting "If you'd like help ...". If you can show what you're trying to do, then people will try to help you.

Sign In or Register to comment.