Terimakasih temen2 atas masukkannya, mungkin itu masih kurang normal ya table 
nya *jadi malu,
sebenernya begini susunan table sebenarnya :

1. Field2 Table A 
    no_kwt,
    no_po,
    id_company,
    bayar,
    cara_bayar,
    no_plat,
    tgl_bayar,
    cicilan_ke,
     

    foreign key (no_kwt,no_po) dari table lain

2. Field2 Table B 
    no_kwt,
    kode_df,
    nama,
    id_company,
    bayar,
    cara_bayar,
    nama_dl,
    no_plat,
    tgl_install,
    hrg_unit,
    tgl_tempo,
    tgl_bayar,
     
    
    primary key kode_df

3. Field2 Table C 
    
    no_kwt,
    no_po,
    id_company,
    bayar,
    cara_bayar, 
    no_plat,
    tgl_bayar,
    

    foreign key (no_kwt,no_po) dari table lain,

Masalah sudah terselesaikan, terimakasih. Namun apabila masih kurang normal, 
biar tambah lebih baik,
mohon masukkannya.., buat belajar lagi :)


--- Pada Sel, 22/6/10, Wadi Achmed <[email protected]> menulis:

Dari: Wadi Achmed <[email protected]>
Judul: Re: [indo-oracle] ask query SQL
Kepada: [email protected]
Cc: "Aud Solehuddin" <[email protected]>
Tanggal: Selasa, 22 Juni, 2010, 10:51 AM







 



  


    
      
      
      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]





    
     

    
    


 



  







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

Kirim email ke