Toggle navigation
Dashboard
Dashboard Tracker
Add / Edit My Forums
System Announcements
Discussion
Active Thread Feed
Top Threads Today
Top Threads This Week
Top Threads Library
Go!
View All
View All
Login
Logout
Home
Forums Index
Server Side
/
PHP Server Side Scripting
5:54 am Apr 28, 2026
This page requires javascript.
Forum Moderators:
coopster
Message Too Old, No Replies
group them to have the same average
Jiaxin
Msg#:4337409
3:55 pm on Jul 9, 2011
(gmt 0)
Hi, I need help with this.
If I have a table, in the database containing fruits, price, quantity.
I want to arrange the price of the fruits into 3 groups of around the same average. Is it possible?
Thank you
rocknbil
Msg#:4337417
4:32 pm on Jul 9, 2011
(gmt 0)
You probably only need mysql, order by and avg().
select table.username, avg(score) as average from table group by table.title order by avg(score) asc;
May give you syntax errors but that's the direction to move in.
avg()
[dev.mysql.com]
Jiaxin
Msg#:4337419
4:38 pm on Jul 9, 2011
(gmt 0)
Yeah, i did have that. and i created array. im stuck after that =/
rocknbil
Msg#:4338000
4:16 pm on Jul 11, 2011
(gmt 0)
Why did you need to create an array? That might be where it's getting mixed up. Does the data output raw from mysql in the correct order?
Join The Conversation
Register
For Free! -
Become a
Pro Member
!
See forum categories
-
Enter the Forum
Moderators and Top Contributors
Moderator List
| Top Contributors:
This Week
,
This Month
,
Mar
,
Feb
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
April 2026 Google Search Observations
Hello again, it's been a while
AdSense Earnings and Observations - April 2026
Do you get tired of others copying your content?
5 SEO Tips That Actually Worked for My Blog in 2026
I need some SEO help
iPhone Safari 26.4.1 errors: IPv4 & Host
2025 Link Building Trends and Insights
Does SEO matter any more?
SEO question
Home
Forums Index
Server Side
/
PHP Server Side Scripting
5:54 am Apr 28, 2026