Home > database >  Oracle11gr1 line how to query is used to implement dynamic column
Oracle11gr1 line how to query is used to implement dynamic column

Time:09-25

The following are three tables:
CT table
CTID CTNAME
11 CT1
12 CT2
13 tc3,
14 CT4
CG table
CGID CGNAME
21 CG1
22 CG2
23 CG3
24 CG4
25 CG5
CTCG table
CTID CGID
November 21
11 22
November 23
12 21
12 and 24
14 25
Want to get query:
CTNAME CGNAME
CT1 CG1 CG2, CG3
CT2 CG1, CG4
Tc3,
CT4 CG5

Excuse me, how to write SQL statements:

http://sqlfiddle.com/#! 4/b36688/125

Seek help from god;

CodePudding user response:

The building Lord baidu listagg under the function, is to solve your problem,

CodePudding user response:

reference 1st floor selling fruit net reply:
under the building Lord baidu listagg the function, is to solve your problem,

Oracle 11 r1 is not the function,,, is there any other?

CodePudding user response:

refer to the second floor megachilles response:
Quote: refer to 1st floor selling fruit net reply:
under the building Lord baidu listagg the function, is to solve your problem,

Oracle 11 r1 is not the function,,, is there any other?

WM_CONCAT this function can solve your problem.

CodePudding user response:

reference 3 floor springs of water faint reply:
Quote: refer to the second floor megachilles response:

Quote: refer to 1st floor selling fruit net reply:
under the building Lord baidu listagg the function, is to solve your problem,

Oracle 11 r1 is not the function,,, is there any other?

WM_CONCAT this function can solve your problem,

Oracle 11 g without the wm concat function,,, is there any other way, please grant instruction!

CodePudding user response:

Please grant instruction cannot use wm concat and listagg, 11 g r1 that version two all have no,,,,

CodePudding user response:

The
reference 5 floor megachilles reply:
please grant instruction cannot use wm concat and listagg, 11 g r1 that version two all have no,,,,

Is wm_concat function, not the wm concat function,
  • Related