Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Learning DBI

by Bishma (Beadle)
on Nov 08, 2002 at 09:36 UTC ( [id://211382]=note: print w/replies, xml ) Need Help??


in reply to Learning DBI

Here's a question that would help me out. Is it possible to select a row where some field is the largest in the table?

For example, say I want to fetch the row with the most recent date (format 20021108).

Replies are listed 'Best First'.
Re: Re: Learning DBI
by gjb (Vicar) on Nov 08, 2002 at 09:43 UTC
    SELECT MAX(article) AS article FROM shop
    
    +---------+
    | article |
    +---------+
    |       4 |
    +---------+
    
    Taken from the MySQL docs.

    Hope this helps, -gjb-

      that's cool, but how dow I get it to return the whole row?
      UPDATE:Never mind, I figured it out.

      Thanks for the help everyone, I think I'm getting a handle on this now.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-25 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found