Retrieving multiple rows and placing in 1 string (1 Viewer)

cfraser

New member
Local time
Today, 06:39
Joined
Jan 16, 2013
Messages
3
Hi Guys

I have the following problem.

I am very new to SQL and I am busy using microsoft access to learn the syntax.

I am trying to write a query that selects multiple rows of a table and puts those into a single string with a comma delimiter.

I want it to select all rows after a specific word is found in the row above and then stop selecting when another specific word below the last row is found.

Example below: >>>

The data i am using is very unorganised and has not headers, so I have to try and specific lines in order to allocate them to a specific user.

Sample Data:

ID FullContent
459 Authorized Privileges:
460 ACNT ALLSPOOL ALTPRI AUDIT BUGCHK BYPASS
461 CMEXEC CMKRNL DIAGNOSE DOWNGRADE EXQUOTA GROUP
462 GRPNAM GRPPRV IMPERSONATE IMPORT LOG_IO MOUNT
463 NETMBX OPER PFNMAP PHY_IO PRMCEB PRMGBL
464 PRMMBX PSWAPM READALL SECURITY SETPRV SHARE
465 SHMEM SYSGBL SYSLCK SYSNAM SYSPRV TMPMBX
466 UPGRADE VOLPRO WORLD
467 Default Privileges:

Output Expected:

"
ACNT,ALLSPOOL,ALTPRI,AUDIT,BUGCHK,BYPASS,CMEXEC,CMKRNL,DIAGNOSE,DOWNGRADE,EXQUOTA,GROUP,GRPNAM,GRPPRV,IMPERSONATE,IMPORT,LOG_IO,MOUNT,NETMBX,OPER…etcc"

The delimiter can be anything.
 

Users who are viewing this thread

Top Bottom