![]() |
stupid mysql question
I know it's easy and I think the word I am looking for is MAX, but how do I get the maximium value of a column in a table? For example, the highest userid in the user table?
I am bone tired and too wiped to go looking for it tonight. The way I was doing it seems really slow when I look at debug. I was selecting 1 ordering by userid desc. Thanks in advance. I owe somebody a cheerful answer to one stupid question :D Amy |
Your way ordering in desc would work.
This would also work: PHP Code:
|
Thank you Erwin. Yes, I know my way worked, but when I ran the board in debug mode I saw that it was taking a long time to run that query. I am trying to optimize a bit and thought I would try this. Thank you :)
Amy |
OMG I can't believe the difference changing those two queries made. Before, my forumhome took 1.4 seconds to load on average. I upgraded to mysql 4 and got it down to between .89 and 1.2 seconds.
Changing two queries to get the MAX correctly instead of my way means forumhome now loads in .30 seconds! Amy |
All times are GMT. The time now is 05:26 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|