MySQL "Distinct, Count, Group By" issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
disconne
Forum Newbie
Posts: 9
Joined: Fri Sep 19, 2008 3:31 am

MySQL "Distinct, Count, Group By" issue

Post by disconne »

in a table like below:
articleno______ipno
10__________1.1.1.1
20__________2.2.2.2
10__________1.1.1.1
10__________3.3.3.3
20__________1.1.1.1
30__________5.5.5.5
30__________5.5.5.5
30__________5.5.5.5
30__________6.6.6.6
30__________7.7.7.7
30__________2.2.2.2

I want a result with sql like this
articleno__________Count of Distinct Values
10_____________________2
20_____________________2
30_____________________4

Can you please help by writing also the echo command line with sql line

thanks
Post Reply