Ok, terimakasih atas pencerahan rekan2 semua, masalah sudah terjawab. saya
query pake :


select a.nip,a.nama,b.indek lama,c.indek baru from tb_pegawai a

left join tb_gaji b on a.jab_l = b.jabatan and b.gajimin < a.gaji_l
and a.gaji_l
<= b.gajimak

inner join tb_gaji c on c.jabatan = a.jab_b and c.gajimin < a.gaji_b
and a.gaji_b
<= c.gajimak
where nip='1111'


BestRegard,

Itsna

Pada 25 Agustus 2010 14.18, wendi gunawan <[email protected]> menulis:

>
>
> klo jabatan lama bisa di null..kamu tinggal left join kan aja..
> jadi kira2 querynya gini
>
>
> select a.nip,a.nama,b.indek lama,c.indek baru
> from tb_pegawai a
> *left join* tb_gaji b on a.jab_l=b.jabatan
> inner join tb_gaji c on c.jabatan = a.jab_b
>
> 2010/8/25 Itsnasov Mc Rodsky <[email protected] <rmansti%40gmail.com>>
>
>
> >
> >
> > ups... maaf kepencet tadi.
> > Dear all,
> > saya ada 2 table sbb :
> > 1. tb_pegawai
> > NIP NAMA JAB_L GAJI_L JAB_B GAJI_B
> > 1111 AAA 0 STA 500000 (ket. peg. baru)
> > 2222 BBB STA 100000 SPV 1500000
> > 2. tb_gaji
> > INDEK JABATAN GAJIMIN GAJIMAK
> > 01 STA 0 500000
> > 02 STA 500001 1000000
> > 03 STA 1000001 1500000
> > 04 SPV 500001 1000000
> > 05 SPV 1000001 1500000
> >
> > saya lakukan query sbb :
> >
> > select a.nip,a.nama,b.indek lama,c.indek baru from tb_pegawai a,tb_gaji
> b,
> > tb_gaji c
> > where a.nip='2222' and a.jab_l=b.jabatan and ((b.gajimin < a.gaji_l and
> > a.gaji_l <= b.gajimak) and (b.jabatan = a.jab_l or a.jab_l='')) and
> > (c.gajimin < a.gaji_b and a.gaji_b <= c.gajimak) and c.jabatan = a.jab_b
> >
> > hasilnya :
> >
> > 2222 BBB 01 05
> >
> > masalahnya saat saya query dengan NIP = 1111 data tidak tampil, karena
> > pegawai 1111 adalah pegawai baru sehingga jabatan lama tidak ada.
> > Gimana solusinya.
> >
> > Terimakasih sebelumnya
> >
> > Itsna
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
>
> --
> wendi gunawan
> Java Software Developer & penulis (new bie)
> terus belajar untuk tidak cinta dunia
> http://oretanwendi.wordpress.com/
> hp:085624046906
>
>
> [Non-text portions of this message have been removed]
>
>  
>


[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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/indo-oracle/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/indo-oracle/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Kirim email ke