u can try this.. select sum(nilai_trans) from B where urut_trans < (select max(urut_trans) from A group by no_trans);
gut luck On 4/9/07, ali dharmala <[EMAIL PROTECTED]> wrote: > > guys.. > mo nanya perintah sql nya ni... > > saya punya 2 tabel > > tabel A isi nya > no trans no urut trans nilai tabel A > 1 1 300 > 1 2 450 > 1 3 100 > kalo saya select no_trans,max(urut_trans) > khan dapet 1 3 > > hasil nya saya mo join ke tabel B yg isi nya > > no_trans no urut trans nilai trans > 1 1 10 > 1 2 20 > 1 3 30 > > saya mo ambil jumlah seluruh nilai trans yg no urut > trans nya di bawah max(nilai_trans) tabel A > > pertanyaan nya : > gmana join ke dua tabel diatas... > > Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to > friends. http://mobile.yahoo.com/mail > > [Non-text portions of this message have been removed]
