Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Is there a method to fetch the last value stored in a DB column with out having to read in the entire column?

Reply
Thread Tools

Is there a method to fetch the last value stored in a DB column with out having to read in the entire column?

 
 
DeWitt Phillips
Guest
Posts: n/a
 
      12-12-2003
First let me say thank you. I am trying to extract the last value entered
into a database column without having to read through every value stored in
the column. Is that something that is easy to do?


 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      12-12-2003
It is easy if there's a column with a datetimestamp. You would just use the
datetimestamp in the WHERE clause, set the order to DESC and pick off the
very first record.

"DeWitt Phillips" <(E-Mail Removed)> wrote in message
news:tFaCb.611$pm5.382@okepread01...
> First let me say thank you. I am trying to extract the last value entered
> into a database column without having to read through every value stored

in
> the column. Is that something that is easy to do?
>
>



 
Reply With Quote
 
 
 
 
Joe Gass
Guest
Posts: n/a
 
      12-12-2003
Providing you have a consectutive identity, then ordering by this in a
desending order - then selecting the first row (top 1)

e.g.
select top 1 yourField from yourTable order by id desc


"DeWitt Phillips" <(E-Mail Removed)> wrote in message
news:tFaCb.611$pm5.382@okepread01...
> First let me say thank you. I am trying to extract the last value entered
> into a database column without having to read through every value stored

in
> the column. Is that something that is easy to do?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UnicodeDecodeError having fetch web page Barry Python 9 05-27-2010 05:00 AM
Class of the calling Object, is there someway to fetch it (from thecalled method)? thunk Ruby 8 03-27-2010 11:54 AM
How to set table column width except the last column? Cal Java 1 01-08-2007 06:55 AM
Add column to the last column of Datagrid Hai Nguyen ASP .Net 0 01-16-2004 10:10 PM



Advertisments