Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: MySQL question

by Jazz (Curate)
on Mar 28, 2002 at 21:52 UTC ( #155127=note: print w/ replies, xml ) Need Help??


in reply to MySQL question

To get the highest number, you can just order by version in descending order:

SELECT title, doc_num ORDER by version DESC

Or is there a particular reason you want to use MAX?

Also, if you just want the one with the latest version, then you can use the LIMIT clause to get only one result:

SELECT title, doc_num ORDER by version DESC LIMIT 1


Comment on Re: MySQL question
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://155127]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2015-07-08 05:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls