Bro Hardi thanks berat atas solusinya...
cara yang kedua yang saya pakai pake union All





Hardi Tandiono <[email protected]> 
Sent by: [email protected]
11/17/2009 09:20 PM
Please respond to
[email protected]


To
[email protected]
cc

Subject
Re: [indo-oracle] Tanya query SQL






 
select ta.vendor_code, ta.vendor_ name,ta.curr, ta.amount Amount 
A,nvl(tb.amount, 0) Amount B
from transA ta,
transB tb
where tb.vendor_code( +) = ta.vendor_code
and tb.curr (+) = ta.curr

scipt ini kurang aman sebab misalnya table transA tidak memiliki jumlah 
data yang sama dengan transB maka data yang ada di transB tidak akan 
muncul begitu juga sebaliknya.
untuk lebih aman lebih baik mengunakan UNION ALL

select vendor_code, vendor_ name,curr,sum(amount a)amt_a ,sum(Amount 
B)amt_b from()
select ta.vendor_code, ta.vendor_ name,ta.curr, ta.amount Amount A,0 
Amount B
from transA ta
union all
select tb.vendor_code, tb.vendor_ name,tb.curr, 0 Amount A,tb.amount 
Amount B
from transB tb)group by vendor_code, vendor_ name,curr

________________________________
From: Antonius Bayu <[email protected]>
To: [email protected]
Sent: Tue, November 17, 2009 7:24:54 PM
Subject: Re: [indo-oracle] Tanya query SQL

____________ _________ _________ __
From: "ali.ak...@kawasaki. co.id" <ali.ak...@kawasaki. co.id>
To: indo-oracle@ yahoogroups. com
Sent: Tue, November 17, 2009 12:03:48 PM
Subject: Re: [indo-oracle] Tanya query SQL

sorry ini view yg akan di cari , yg tadi salah ketik (penempatan) ...mohon 

maaf
di group ini gak bisa send email with attacment file yah ( kemarin gambar 
table dan view capture )
oke saya ketik manual

Table : Vendor

Vendor Code Vendor Name
A01 PT. ABC
A02 PT. DEF
A03 PT. GHI
A04 PT. JKL
A05 PT. MNO

Table : Trans A

Vendor Code Vendor Name Curr Amount
A01 PT. ABC IDR 20,000
A01 PT. ABC USD 234
A02 PT. DEF IDR 30,000
A03 PT. GHI IDR 40,000

Table : Trans B

Vendor Code Vendor Name Curr Amount
A01 PT. ABC IDR 70,000
A03 PT. GHI IDR 25,000
A03 PT. GHI USD 251
A04 PT. JKL USD 271

View : ABC ( view yg dicari )

Vendor Code Vendor Name Curr Amount A Amount B
A01 PT. ABC IDR 20,000 70,000
A01 PT. ABC USD 234 0
A02 PT. DEF IDR 30,000 0
A03 PT. GHI IDR 40,000 25,000 
A03 PT. GHI USD 0 251
A04 PT. JKL USD 0 271

eko putra <ekoputra2007@ yahoo.com> 
Sent by: indo-oracle@ yahoogroups. com
11/16/2009 08:57 PM
Please respond to
indo-oracle@ yahoogroups. com

To
indo-oracle@ yahoogroups. com
cc

Subject
Re: [indo-oracle] Tanya query SQL

ini mau buat view "tabel-tabel di bawah ini" .. Mana table-nya..?

____________ _________ _________ __
From: "ali.ak...@kawasaki . co.id" <ali.ak...@kawasaki . co.id>
To: indo-oracle@ yahoogroups. com
Sent: Fri, November 13, 2009 5:42:59 PM
Subject: [indo-oracle] Tanya query SQL

Haloo brother's 

Untuk menghasilkan VIEW : ABC dari tabel-tabel di bawah ini
gimana yah SQL nya :

Thanks sebelumnya.

Ali Akbar

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]

Kirim email ke