x

Pull latest record from table with dupes

Greetings SQL Team, I have a table that builds records as a status. I have a web page where I only want to grab the latest Status to the others that are old.

Fields are these

Status ... which has RECEIVED, On Hold and Sold Book Name ... name of book Seller ... Person who bought book

Can anyone provide me a select statement or an additional field and select statement that grabs the latest data as it has been populated by another procedure?

I appreciate your help.

edb2010

more ▼

asked Apr 16 '10 at 03:31 PM in Default

Edb gravatar image

Edb
1 1 1

How do you define latest status? Does one of the fields hold a date? Please edit your question to provide this information.
Apr 19 '10 at 12:41 PM graz ♦
(comments are locked)
10|1200 characters needed characters left

2 answers: sort oldest

select * from
order by status asc/desc

more ▼

answered Apr 19 '10 at 10:26 AM

user-1130 (google) 1 gravatar image

user-1130 (google) 1
1

(comments are locked)
10|1200 characters needed characters left

select * from table name order by status asc/desc

more ▼

answered Apr 19 '10 at 10:27 AM

user-1130 (google) 1 gravatar image

user-1130 (google) 1
1

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x472

asked: Apr 16 '10 at 03:31 PM

Seen: 361 times

Last Updated: Apr 16 '10 at 03:31 PM