Re: How to complete the requirement by writing an oracle sql?

From: Quanwen Zhao <quanwenzhao_at_gmail.com>
Date: Tue, 11 Apr 2023 08:45:19 +0800
Message-ID: <CABpiuuRO1-13=HAmLibb76kcEc0UOjiRKk8fEBf4YiPAoKt6tg_at_mail.gmail.com>



Thank you so much, I'll try it using the approach you suggested.

Best Regards
Quanwen Zhao

Sayan Malakshinov <xt.and.r_at_gmail.com> 于2023年4月10日周一 22:56写道:

> Left join & size1-nvl(size2, 0)
>
>
>
> Best regards,
> Sayan Malakshinov
> Oracle performance tuning expert
> Oracle Database Developer Choice Award winner
> Oracle ACE
> http://orasql.org
>
> On Mon, 10 Apr 2023, 15:53 Quanwen Zhao, <quanwenzhao_at_gmail.com> wrote:
>
>> Hello there,
>>
>> I've a requirement about how to retrieve the final calc result from two
>> number of tables (A and B) from oracle database, such as:
>>
>> table A:
>>
>> TS_NAME USED_SIZE(MB)
>>> -------------- ------------------------
>>> a 10
>>> b 20
>>> c 30
>>> d 40
>>> e 50
>>
>>
>> table B:
>>
>> TS_NAME USES_SIZE(MB)
>>> --------------- ------------------------
>>> a 2
>>> b 6
>>> e 20
>>
>>
>> I expect to acquire the result like this:
>>
>> TS_NAME USED_SIZE(MB)
>> --------------- -------------------------
>> a 8
>> b 14
>> c 30
>> d 40
>> e 30
>>
>> How to use the SQL to finish it?
>>
>> Best Regards
>> Quanwen Zhao
>>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Apr 11 2023 - 02:45:19 CEST

Original text of this message