>> last result in a table

"last": by what criteria?

keep in mind that if you want to retrieve the latest record then this
may not be the best way. All you'll get is a snapshot AT THAT TIME. If
you're using it to create a client (CF code) driven "autonumber" then
Gareth's suggestion of MAX() may work better. 

just rermember, if another record is added in the meantime then it may
no longer be the "last"

just my 2c worth.
barry.b



-----Original Message-----
From: Kevin Faulkner [mailto:[EMAIL PROTECTED] 
Sent: Friday, 2 April 2004 2:44 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: how can i last result in a table (mysql) ???

unfortunately TOP's not supported in most (if not all?) mySQL,  I think
the
way is to use LIMIT.
( from mySQL.org ... SELECT a FROM tbl_name WHERE a=10 AND B=1 ORDER BY
a
LIMIT 10 )


----- Original Message -----
From: "Barry Beattie" <[EMAIL PROTECTED]>
To: "CFAussie Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, April 02, 2004 2:38 PM
Subject: [cfaussie] RE: how can i last result in a table (mysql) ???


do a decending/reverse order and select top 1

select top 1 from tGroup DEC


-----Original Message-----
From: rob [mailto:[EMAIL PROTECTED]
Sent: Friday, 2 April 2004 2:35 PM
To: CFAussie Mailing List
Subject: [cfaussie] how can i last result in a table (mysql) ???

sorry i know a dumb question but i really need to know!!

its friday!!!


Robert Shaw
Online Learning
[EMAIL PROTECTED]
MLC School
Rowley Street
Burwood  2134
Phone: 97471266
Mobile: 0422222515
Fax: 97453254


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004




---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to