Hi I would like to know how to create a MySQL statement with Count(*) and natural join.

I have a table named iphead and another table named even. iphead has a number of IP addresses and I would like to count the total number using count(*). Next, the even table has the corresponding signatures which I would like to join to the counted IP addresses using even.sid=iphead.sid.

Can anyone help me?

OK

I seem to run Python v2.6 that does not support the Counter()feature. Is there any way in which I can do this without using Counter(). That is, can I count the IP addresses manually using some kind of a logic?

Hi,
I have a thousands of IP addresses, repeating randomly in my database and I wish to print each IP address along with the number of times they are repeated.

For example,
162.10.2.1
162.10.2.1
162.10.2.1
192.34.1.10
172.11.2.9
192.34.1.10
192.34.1.10

Output:
162.10.2.1 - 3
192.34.1.10 - 3
172.11.2.9 - 1

I have used Counter() to do this manually by listing them individually and then using Counter(list). As there are thousands of IP addresses, it is impossible to list them out manually in the program. Is there any way where I can get the output with a for loop or anything else?

Hi,
I have a thousands of IP addresses, repeating randomly in my database and I wish to print each IP address along with the number of times they are repeated.

For example,
162.10.2.1
162.10.2.1
162.10.2.1
192.34.1.10
172.11.2.9
192.34.1.10
192.34.1.10

Output:
162.10.2.1 - 3
192.34.1.10 - 3
172.11.2.9 - 1

I have used Counter() to do this manually by listing them individually and then using Counter(list). As there are thousands of IP addresses, it is impossible to list them out manually in the program. Is there any way where I can get the output with a for loop or anything else?

Editor's note:
Please do not hijack an existing thread, start your own thread with the appropriate title.