Need a Concatanate By Group Aggregate Command For Pervasive SQL

533 views Asked by At

Suppose I have a table like this:

JOB_NUMBER |     PART  
-----------+------------
JOB 1      |     PART A  
JOB 2      |     PART B  
JOB 2      |     PART C  
JOB 4      |     PART D  
JOB 3      |     PART E

In my Pervasive database I need to run a command that will give me this output:

JOB_NUMBER |    PART
-----------+--------------------
JOB 1      |    PART A
JOB 2      |    PART B, PART C
JOB 4      |    PART D
JOB 3      |    PART E

SQL PSEUDO Code

SELECT JOB_NUMBER, CONCATENATE_GROUP_BY(PART) as PART FROM JOB_NUMBER_TABLE
GROUP BY JOB_NUMBER

I have found some post on Stackoverflow.com people handling this type of thing in Orcal and MySql, I am SQL amateur and need some help here.

Links for reference:
Concatenate many rows into a single text string?
Concatenate and group multiple rows in Oracle

0

There are 0 answers