Forum Stats

  • 3,851,482 Users
  • 2,263,987 Discussions
  • 7,904,735 Comments

Discussions

How to rearrange query result in excel format using different queries

user12251389
user12251389 Member Posts: 335 Blue Ribbon
edited Aug 17, 2017 4:58AM in SQL & PL/SQL

I have below 2 queries which i have joined them using UNION ALL. I want this result in excel format because i want to paste the query result in excel and it will reduce my manual work if i format it in query itself. I tried previously directly to use PLSQL Procedure and get the result in excel but it looks very complex. I believe i can also use Pivot function in sql but i havent tried before.

Below is my running query:

Select * from test 1)

UNION ALL

(Select * from test 2

)

Tagged:

Answers

  • Stew Ashton
    Stew Ashton Member Posts: 2,911 Bronze Crown
    edited Jul 31, 2017 4:22AM

    I already answered a remarkably similar question by you very recently.

    Best regards, Stew

  • user12251389
    user12251389 Member Posts: 335 Blue Ribbon
    edited Jul 31, 2017 4:28AM

    @Stew but i wont be able to formulate it and got an error as my first query is very complex. So i dont know how do i separate it and make it more flexible like you suggest previously. Also i dont know how to separate the query result into different column like i mentioned here.

    thanks and regards

  • Stew Ashton
    Stew Ashton Member Posts: 2,911 Bronze Crown
    edited Jul 31, 2017 4:38AM
    user12251389 wrote:@Stew but i wont be able to formulate it and got an error as my first query is very complex. So i dont know how do i separate it and make it more flexible like you suggest previously. Also i dont know how to separate the query result into different column like i mentioned here.thanks and regards

    In the other thread you provided a test case to work with. Here you don't.

    In the other thread, with a simpler problem and a working test case, you didn't understand my answer. How do you expect to understand the answer to a complex problem if you don't understand the answer to a simple problem?

    May I ask you to go back to the other thread and reassure me that you understand that answer? Or if the answer is wrong, explain how.

    Best regards, Stew

This discussion has been closed.