seandainya X bukan hanya sampai 3 tapi sampai N..
mungkin tidak ya bila kita gunakan looping??

2008/4/1 Privida Kristiono <[EMAIL PROTECTED]>:

>   anda bisa gunakan bentuk query berikut ini
>
> SELECT BRANCH,
> SUM(DECODE(TYPE,'X1',1,0)) AS X1,
> SUM(DECODE(TYPE,'X2',1,0)) AS X2,
> SUM(DECODE(TYPE,'X3',1,0)) AS X3
> FROM TBL_TRANS GROUP BY BRANCH;
>
> Salam,
> Privida
>
>
> --- AnRof Rawnan <[EMAIL PROTECTED] <muhammad.ilman%40gmail.com>>
> wrote:
>
> > Dear,
> >
> > mohon bantuannya untuk case berikut, mohon maaf bila
> > sudah pernah...:)
> > bila saya punya table
> >
> > |BRANCH |TYPE |
> > --------------------------------
> > |A |X1 |
> > |A |X1 |
> > |A |X2 |
> > |A |X3 |
> > |B |X1 |
> > |B |X2 |
> > |B |X2 |
> > |B |X3 |
> > |C |X1 |
> > |C |X2 |
> > |C |X3 |
> > |C |X3 |
> > -----------------
> >
> > bagaimana querynya untuk mendapatkan hasil :
> >
> > ---------------------------
> > X1 X2 X3
> > ---------------------------
> > A 2 1 1
> > B 1 2 1
> > C 1 1 2
> >
> > Terima Kasih sebelumnya...
> >
> >
> > --
> > YM_id : muh_ilman_a
> > http://misisawa.blogspot.com
> > http://anrof.myminicity.com/
> >
> >
> > [Non-text portions of this message have been
> > removed]
> >
> >
>
> __________________________________________________________
> You rock. That's why Blockbuster's offering you one month of Blockbuster
> Total Access, No Cost.
> http://tc.deals.yahoo.com/tc/blockbuster/text5.com
>  
>



-- 
YM_id : muh_ilman_a
http://misisawa.blogspot.com
http://anrof.myminicity.com/


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

Kirim email ke