Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Merging two query results into one in Oracle

 
Pawan Choure
Greenhorn
Posts: 27
Eclipse IDE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Fatih Keles
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can not see your objective but this may help

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic