The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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 Amy |
#2
|
||||
|
||||
Your way ordering in desc would work.
This would also work: PHP Code:
|
#3
|
||||
|
||||
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 |
#4
|
||||
|
||||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|