×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SQL Union only returns partial data

SQL Union only returns partial data

SQL Union only returns partial data

(OP)
Good Evening,

I've created a union statement which has 2 subqueries,in Oracle 11 sql developer. It compiles successfully, but when I looked at the data, I noticed that the only information being returned is from the first subquery. I've been troubleshooting it for the past 2 days and am completely out of options. Can someone take a look and point me in the right direction.  Thanks

SELECT  "ACACTIVITY"."ACTIVITY_GRP",
        "ACACTIVITY"."ACTIVITY",
        "ACACTIVITY"."BALANCE_AMOUNT",
        "ACACTGRP"."DESCRIPTION",
        "ACACTIVITY"."DESCRIPTION",
        "ACACCTCAT"."DESCRIPTION",
        "ACACCTCAT"."ACCT_CATEGORY",
        "ACBUDDTL"."BALANCE",       
        "ACTRANS"."ACCOUNT" AS ACTRANSACCT,
        "ACTRANS"."ACCT_UNIT" AS ACTRANSACCTUNIT,
        "ACTRANS"."SUB_ACCOUNT" AS ACTRANSSUBACT,
        "ACTRANS"."POSTING_DATE" AS ACTRANSPOSTDT,
        "ACTRANS"."R_SYSTEM" as ACTRANSYS,
        "ACTRANS"."REFERENCE" as ACTRANSREF,
        "ACTRANS"."DESCRIPTION" as ACTRANSDESC,
        "ACTRANS"."TRAN_AMOUNT" as ACTRANSAMT,
        "ACTRANS"."UNITS_AMOUNT" as ACTRANSUNIT,
        "ACTRANS"."ACT_CURRENCY" as ACTRANCURR,
        null as col19,
        null as col20,
        null as col21
FROM   ((("PROD"."ACACTIVITY" "ACACTIVITY" INNER JOIN "PROD"."ACACTGRP" "ACACTGRP" ON "ACACTIVITY"."ACTIVITY_GRP"="ACACTGRP"."ACTIVITY_GRP")
      INNER JOIN "PROD"."ACTRANS" "ACTRANS" ON "ACACTIVITY"."ACTIVITY"="ACTRANS"."ACTIVITY")
      INNER JOIN "PROD"."ACBUDDTL" "ACBUDDTL" ON ("ACACTIVITY"."ACTIVITY"="ACBUDDTL"."ACTIVITY") AND ("ACACTIVITY"."ACTIVITY_GRP"="ACBUDDTL"."ACTIVITY_GRP"))
      INNER JOIN "PROD"."ACACCTCAT" "ACACCTCAT" ON "ACTRANS"."ACCT_CATEGORY"="ACACCTCAT"."ACCT_CATEGORY"
Union
SELECT "ACACTIVITY"."ACTIVITY_GRP",
       "ACACTIVITY"."ACTIVITY",
       "ACACTIVITY"."BALANCE_AMOUNT",
       "ACACTGRP"."DESCRIPTION",
       "ACACTIVITY"."DESCRIPTION",
       "ACACCTCAT"."DESCRIPTION",
       "ACACCTCAT"."ACCT_CATEGORY",
       "ACBUDDTL"."BALANCE",
       null,
       null,
       null,
       null,
       null,
       null,
       null,
       null,
       null,
       null,
       "ACCOMMITX"."ACTIVITY",
       "ACCOMMITX"."ACCT_CATEGORY",
       "ACCOMMITX"."TRAN_AMOUNT"
FROM   ((("PROD"."ACACTIVITY" "ACACTIVITY" LEFT OUTER JOIN "PROD"."ACCOMMITX" "ACCOMMITX" ON "ACACTIVITY"."ACTIVITY"="ACCOMMITX"."ACTIVITY")
      INNER JOIN "PROD"."ACACTGRP" "ACACTGRP" ON "ACACTIVITY"."ACTIVITY_GRP"="ACACTGRP"."ACTIVITY_GRP")
      INNER JOIN "PROD"."ACBUDDTL" "ACBUDDTL" ON ("ACACTIVITY"."ACTIVITY"="ACBUDDTL"."ACTIVITY") AND ("ACACTIVITY"."ACTIVITY_GRP"="ACBUDDTL"."ACTIVITY_GRP"))
      INNER JOIN "PROD"."ACACCTCAT" "ACACCTCAT" ON "ACCOMMITX"."ACCT_CATEGORY"="ACACCTCAT"."ACCT_CATEGORY"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close