Generation of additional lines for sets of lines

Hello

I need generate extra lines to my games of lines, which is grouped.

I need a new line of pro group. I tried to make it with union all, but he does not succeed because I can't give groups how I in advance.

Could you help me?

Best regards, Bruno

Hello Bandla123

You can use the functions of grouping for this purpose.

For example, you can use this:

SELECT col_num, col_text, col_ord

FROM (SELECT 1 AS COL_NUM AS COL_TEXT, 11 "Apple-1' AS COL_ORD FROM DUAL UNION ALL ')

SELECT 1 AS COL_NUM AS COL_TEXT, 12 ' Apple-2' AS COL_ORD FROM DUAL UNION ALL.

SELECT 1 AS COL_NUM AS COL_TEXT, 13 ' Apple-3' AS COL_ORD FROM DUAL UNION ALL.

2. SELECT AS COL_NUM, ' Ball-4' AS COL_TEXT, 14 AS COL_ORD FROM DUAL UNION ALL.

2. SELECT AS COL_NUM, "Ball-5' AS COL_TEXT, 15 AS COL_ORD FROM DUAL UNION ALL.

3. SELECT AS COL_NUM AS COL_TEXT, 16 ' dog-6' AS COL_ORD FROM DUAL UNION ALL.

4. SELECT AS COL_NUM, COL_TEXT, 17 "water - 7' AS COL_ORD FROM DUAL UNION ALL

4. SELECT AS COL_NUM, COL_TEXT, 18 'water - 8' AS the DOUBLE COL_ORD

)

GROUP BY GROUPING SETS ((col_num), (col_num, col_text, col_ord))

;

I think that this could be the solution for you.

Best regards, David

Tags: Database

Similar Questions

Maybe you are looking for

  • FN + F4 hibernates without confirmation

    Sometimes I press Fn + F4 rather Ctrl + F4 and computers into hibernation and wasting time while waiting to start again. Is a way to restore the confirmation of hibernation when you press Fn + F4? I've marked the box for "don't ask again", and now wh

  • Problem with JAVA on Sateliite Pro 6000

    I have problems running versions of Java 1.4 and higher. My laptop freezes and has to be restarted. Since I found that other users of this model of laptop in our society have the same problem. Is there a known problem with the Satellite Pro 6000? The

  • Batch file to remove the disc - how to stop

    Whenever I start my computer, I lose my desktop settings. I noticed this message: \Device\Harddisk1\DR1 Next, I check the cmd, it reads: If exist h:\. NET use H:/d I don't know how or why, or what keeps it doing.  I also noticed that sometimes my net

  • I just changed my internet provider and can connect with two of our cell phones, but the third said no identified network/no access to the internet.

    I just changed my internet provider and can connect with two of our cell phones, but the third said no identified network/no access to the internet.  I tried all of the obvious solutions.  Windows 7 Original title: unidentified network

  • Split tunnel

    Hi guys,. I wonder if remote access VPN with split tunnel is using the home user or the corporate to surf internet connection own internet connection? Any help will be greatly appreciated. Thank you Lake