wood burning stoves 2.0*
The moose likes Oracle/OAS and the fly likes Merging two query results into one in Oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Merging two query results into one in Oracle" Watch "Merging two query results into one in Oracle" New topic
Author

Merging two query results into one in Oracle

Pawan Choure
Greenhorn

Joined: May 11, 2008
Posts: 27

I have to get two different result on the same table.First Result will be get first then added by Second result



Custid Name Nextactiondt priorityscr lastacssts
65 A 16-JUN-11 11.52 14-MAR-11
84 B 16-JUN-11 1.38 14-MAR-11
93 C 17-JUN-11 0 18-APR-11




Custid Name Nextactiondt priorityscr lastacssts
59 S 16-JUN-11 1212 16-JUN-11


I want to club the result of the two query into 1 as follows.

Custid Name Nextactiondt priorityscr lastacssts
65 A 16-JUN-11 11.52 14-MAR-11
84 B 16-JUN-11 1.38 14-MAR-11
93 C 17-JUN-11 0 18-APR-11
59 S 16-JUN-11 1212 16-JUN-11


but when i am using UNION



I am getting

Custid Name Nextactiondt priorityscr lastacssts
59 S 16-JUN-11 1212 16-JUN-11
65 A 16-JUN-11 11.52 14-MAR-11
84 B 16-JUN-11 1.38 14-MAR-11
93 C 17-JUN-11 0 18-APR-11


but that is different from what i expect

Custid Name Nextactiondt priorityscr lastacssts
65 A 16-JUN-11 11.52 14-MAR-11
84 B 16-JUN-11 1.38 14-MAR-11
93 C 17-JUN-11 0 18-APR-11
59 S 16-JUN-11 1212 16-JUN-11


so any one know how can i append the results of two queries into one since i have order by clause in both queries and i can club them together.
Any help regarding this would be appreciated


Pawan Choure
Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
I can not see your objective but this may help

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Merging two query results into one in Oracle