Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Combining columns of two tables
On Oct 26, 8:28 am, "Sameer" <dolph..._at_gmail.com> wrote:
> Please have a look at this query.
>
> SELECT mr_issues_aging.*, notclosed
> FROM mr_issues_aging,
> (SELECT MODULE AS m,
> COUNT(MODULE) AS notclosed FROM mr_issue_details
> WHERE NOT(laststatus = 'Close')
> GROUP BY MODULE)
> WHERE m = mr_issues_aging.MODULE
>
> I want to create a table having columns of both mr_issues_aging and
> inner query.
> This query is combining columns of both tables but both tables do not
> have same number of rows. The mr_issues_aging table is having one more
> row than the inner query, therefore I am not getting the expected
> output.
> Is this a proper way to add columns from two tables?
> How to resolve this? Can I add some dummy rows to inner query by using
> union, but how to do this?
> Please help.
> -Sameer
Hint: look up 'Outer join' in the documentation (SQL reference manual, and/or Application Developers Manual) and change the join accordingly. Preferably basic questions like this are best answered by manuals, not by posting them here.
-- Sybrand Bakker Senior Oracle DBAReceived on Thu Oct 26 2006 - 03:25:02 CDT
![]() |
![]() |