By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,827 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,827 IT Pros & Developers. It's quick & easy.

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

P: n/a
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?
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <dp*********@cox.net> 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?

Nov 18 '05 #2

P: n/a
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" <dp*********@cox.net> 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?

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.