Linuxmania
20th November 2011, 12:44 AM
Gann :loveindonesia
bikin laporannn ni gann.
mw buat query table seprti ini
Hasil yg di harapkan :ceriwislove:
kelas (misal klas A) || total( 10 anak) ||(pria=4) || (wanita = 6)
Usaha sy ni gan.:D
select
case when class ='Eight' then 'Eight'
when class ='Five' then 'Five'
when class ='Four' then 'Four'
when class ='Nine' then 'Nine'
when class ='Seven' then 'Seven'
when class ='Six' then 'Six'
when class ='Three' then 'Three'
else 'None'
end
AS kelas,
count jumlahall,
case when sex ='female' then count(sex='female')
end
AS sexfemale,
case when sex ='male' then count(sex='female')
end
AS sexmale
from student
group by
(class),sex
katanya di php nya dimainin gann ?
ke bayang ga ?
klo di PHp di mainin ,. :kabur:
</div>
bikin laporannn ni gann.
mw buat query table seprti ini
Hasil yg di harapkan :ceriwislove:
kelas (misal klas A) || total( 10 anak) ||(pria=4) || (wanita = 6)
Usaha sy ni gan.:D
select
case when class ='Eight' then 'Eight'
when class ='Five' then 'Five'
when class ='Four' then 'Four'
when class ='Nine' then 'Nine'
when class ='Seven' then 'Seven'
when class ='Six' then 'Six'
when class ='Three' then 'Three'
else 'None'
end
AS kelas,
count jumlahall,
case when sex ='female' then count(sex='female')
end
AS sexfemale,
case when sex ='male' then count(sex='female')
end
AS sexmale
from student
group by
(class),sex
katanya di php nya dimainin gann ?
ke bayang ga ?
klo di PHp di mainin ,. :kabur:
</div>