|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I wrote a SQL statement to select the data from the database.
Below is the data that i selected from the database by using this SQL statement How can i group the data that have same value for step, prob_freq and rate and count the frequency occurrence as total?? SELECT DISTINCT A.STEP AS STEP, L.ID, L.PROB_FREQ, L.RATE AS RATE FROM LPM_TAB L, ANS_TAB A WHERE A.APPLICATION = 'sistem pembelajaran' AND L.TASK_NO = '3' AND L.GOAL_NO = '3' AND A.MODUL = 'ULANGKAJI' AND A.ID = L.ID GROUP BY A.STEP, L.ID, L.RATE, L.PROB_FREQ ORDER BY L.ID, A.STEP step id prob_freq rate ---- --- ----------- ------- 2 1 sesekali tidak 2 4 jarang ya 2 9 jarang ya I had tried SQL statement below but it count the frequency occurrence as 1 but the frequency occurrence should be 2. SELECT DISTINCT A.STEP AS STEP, L.PROB_FREQ, L.RATE AS RATE, COUNT(DISTINCT(STEP)) FROM LPM_TAB L, ANS_TAB A WHERE A.APPLICATION = 'sistem pembelajaran' AND L.TASK_NO = '3' AND L.GOAL_NO = '3' AND A.MODUL = 'ULANGKAJI' AND A.ID = L.ID GROUP BY A.STEP, L.ID, L.RATE, L.PROB_FREQ ORDER BY A.STEP, L.PROB_FREQ step prob_freq rate (No column name) ---- ----------- ------- ------------------ 2 jarang ya 1 2 sesekali tidak 1 Can anyone please help me on this?? |
|
#2
|
|||
|
|||
|
Moved from ASP
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
Soli, what do u mean by "moved from asp"??
|
|
#4
|
||||
|
||||
|
it means these forums are divided to subjects, and your case is related to SQL Development rather than to ASP Development, so chances are higher that you will get help in this forum because ppl who know SQL look here more often.
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > SQL statement problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|