RE: Get Last Item in DB

2001-07-08 Thread Christopher Olive, CIO

not technically correct.  in an RDBMS, there is no "last row".  the data
"exists" in a set, not a table.  therefore, the "last row" is only relevant
if you mean something like "the last row inserted", AND that you have a
timestamp on it.  therefore, this SQL would look like


SELECT TOP 1 column AS thenewcolum FROM table ORDER BY  DESC

chris olive, cio
cresco technologies
[EMAIL PROTECTED]
http://www.crescotech.com



-Original Message-
From: W Luke [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 6:13 PM
To: CF-Talk
Subject: Re: Get Last Item in DB


SELECT TOP 1 column AS thenewcolum FROM table

Hope this helps


--
Will
new media discussion for Berkshire -=- http://bnm.lukrative.com
local classifieds -=- http://www.localbounty.com
e: [EMAIL PROTECTED]  icq: 31099745

- Original Message -
From: "Mike" <[EMAIL PROTECTED]>
Newsgroups: cf-talk
Sent: Saturday, July 07, 2001 10:21 PM
Subject: Get Last Item in DB


> Hi,
>
> I think this might be a pretty simple SQL question... but here goes:
>
> If I have a bunch of rows in an database, how do I write the CFQUERY to
> return the very last row (and only the last row)?
>
> Thanks in advance,
>
> --
> Mike
>
>
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: Get Last Item in DB

2001-07-08 Thread W Luke

SELECT TOP 1 column AS thenewcolum FROM table

Hope this helps


--
Will
new media discussion for Berkshire -=- http://bnm.lukrative.com
local classifieds -=- http://www.localbounty.com
e: [EMAIL PROTECTED]  icq: 31099745

- Original Message - 
From: "Mike" <[EMAIL PROTECTED]>
Newsgroups: cf-talk
Sent: Saturday, July 07, 2001 10:21 PM
Subject: Get Last Item in DB


> Hi,
> 
> I think this might be a pretty simple SQL question... but here goes:
> 
> If I have a bunch of rows in an database, how do I write the CFQUERY to
> return the very last row (and only the last row)?
> 
> Thanks in advance,
> 
> --
> Mike
> 
> 


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists