|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
you will see my table defination below. How could I count the same events as 1. I am trying to do that count and group by I got the answers that I dont want. In the table script must count eventID 1 as 1 event eventID 2 as 1 and eventID 3 as 1. Total events of 3 . Anay suggestions please?
Best regards mysql> select eventID, reportID from reports; +---------+----------+ | eventID | reportID | +---------+----------+ | 1 | 1 | | 1 | 2 | | 3 | 3 | | 1 | 4 | | 2 | 5 | | 3 | 6 | +---------+----------+ 6 rows in set (0.13 sec) ![]() |
|
#2
|
|||
|
|||
|
Try
SELECT count(DISTINCT `eventID`) FROM `reports`; L |
|
#3
|
|||
|
|||
|
Thats all
Thank you that solved my problem
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Counting the same ID |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|