Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Going to first record on a record set in DBI

by Abigail-II (Bishop)
on Jul 21, 2003 at 12:22 UTC ( #276234=note: print w/replies, xml ) Need Help??


in reply to Re: Going to first record on a record set in DBI
in thread Going to first record on a record set in DBI

Indeed. In a relational way of thinking, it only make sense to talk about the "first N rows", if you have a query with an ORDER BT clause. If you want the "first row" given some ordering, you can often do that with a WHERE clause. Say:
SELECT name, gender FROM people ORDER BY age LIMIT 1

can also be written as

SELECT name, gender FROM people WHERE age = MIN (age)

That is, you ask for the record with minimum age.

Abigail

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2023-06-06 08:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (26 votes). Check out past polls.

    Notices?