As I wrote a script to display cross tab data (for my personal need), I searched for effective methods to get the job done. I came across many techniques that can be used to workout exactly the same job (Cross-tab). However, the simplest technique to do the job is using statement “SELECT DISTINCTROW”.
SELECT DISTINCTROW [FieldName], count([FieldName]) FROM [TableName] Group By [FieldName]
Example
SELECT DISTINCTROW stbayar , count(stbayar) as Jumlah
FROM pengunjung
GROUP BY stbayar
ORDER BY jumlah DESC
this will return
stbayar Jumlah
U 7216
J 5742
A 2987
P 1755
N 242
K 225
L 6
you might want to create your own tricks, please let me know if they work !
Keep sharing on the spirit of UBUNTU
Cari Blog Ini
Langganan:
Posting Komentar (Atom)
Meninjau Kriteria inklusi dan eksklusi dalam pengambilan sampel untuk penelitian.
Menentukan kriteria inklusi dan atau ekslusi dalam penelitian seringkali menjadi permasalahan tersendiri, terutama bagi para mahasiswa yan...
-
Menentukan kriteria inklusi dan atau ekslusi dalam penelitian seringkali menjadi permasalahan tersendiri, terutama bagi para mahasiswa yan...
-
CHOOSING THE STATISTICAL METHOD disampaikan pada workshop Pengolahan dan analisa data Penelitian Kesehatan oleh H. Sastrawan, SKM, MH...
Tidak ada komentar:
Posting Komentar
Write your comment here