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
10:59 am May 21, 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
,
Apr
,
Mar
,
Archive
,
Top 100 All Time
,
Top Voted Members
Hot Threads This Week
May 2026 Google Search Observations
AdSense Earnings and Observations - May 2026
AI visibility audit
Adsense / Personal Manager / Support
Hacker spoofing as GoogleBot
Page indexed but live url test gets 500 error
Link collaboration strategies
in case you missed it .
Microsoft, AS8075. Google, AS396982.
Bad actor claiming to be OpenAi
Home
Forums Index
Server Side
/
PHP Server Side Scripting
10:59 am May 21, 2026