Pertama: Maaf, saya balik nanya.
Kenapa tablenya ada 3 kalau atribut dan fungsinya sama semua?

Solusinya:

Kalau tablenya satu (nama table asumsi table_bayar):
------------------------------
Select id_company, bayar
from table_bayar
where cara_bayar = 'tunai';

Kalau masih maksa pake 3 table
------------------------------
select id_company, bayar
from table_a
where cara_bayar = 'tunai'
union all
select id_company, bayar
from table_b
where cara_bayar = 'tunai'
union all
select id_company, bayar
from table_c
where cara_bayar = 'tunai';

Sekali lagi saya sarankan diubah tablenya cukup satu aja.
Coba pelajari lagi konsep normalisasi database.

Cheers,
Wadi Achmed


On 6/22/2010 5:08 PM, Aud Solehuddin wrote:
> Dear all, terimakasih sebelumnya, minta bantuan nyari query SQL untuk select 
> dari table berikut :
>
>
>
> misal saya punya tiga table,
>
>
>
> table A
>
> id_company
>
> cara_bayar (tunai, bni, bca)
>
> bayar
>
> field lain2
>
>
>
> table B
>
> id_company
>
> cara_bayar (tunai, bni, bca)
>
> bayar
>
> field lain2
>
>
>
> table C
>
> id_company
>
> cara_bayar (tunai, bni, bca)
>
> bayar
>
> field lain2
>
>
>
> contoh isian :
>
> table A
>
>
>
> PT Coba
>
> 200000
>
> tunai
>
>
>
> table B
>
> PT Tes
>
> 500000
>
> bni
>
>
>
> table C
>
> PT Sample
>
> 1000000
>
> tunai
>
>
>
> hasil yang diharapkan (tampil yang tunai) :
>
>
>
> id_company    bayar
>
> PT Coba         200000
>
> PT Sample     1000000
>
>
>
> bagaimana cara saya menampilkan id_company dan bayar, yang memiliki cara 
> bayar ='tunai'
>
>
>
> makasih atas bantuannya semuanya.. :)
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> --
> -----------I.N.D.O - O.R.A.C.L.E---------------
> Keluar: [email protected]
> Website: http://indooracle.wordpress.com
> http://www.facebook.com/group.php?gid=51973053515
> -----------------------------------------------
>
> Bergabung dengan Indonesia Thin Client User Groups,
> Terminal Server, Citrix, New Moon Caneveral, di:
> http://indo-thin.blogspot.comYahoo! Groups Links
>
>
>
>
>    


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

Kirim email ke