Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Leila
Starting Member
5 Posts |
Posted - 2008-06-18 : 08:11:37
|
| Hello,I have a table with 2 columns, let's say: "No. Piece" and "Price".I need to write a select statment that allows me to retrieve the last added records, is it possible?Example:At time t1, we have:Piece 1, 300 EurosPiece 2, 400 EurosPiece 3, 250 EurosAt time t2 = t1 + 5mns, we have:Piece 1, 300 EurosPiece 2, 400 EurosPiece 3, 250 EurosPiece 4, 120 EurosPiece 5, 390 EurosThe select statement should be able to give the following result:Piece 4, 120 EurosPiece 5, 390 EurosThank you in advance for your help and your time.Leïla |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-06-18 : 08:17:12
|
| do you not have a column that contains the time it was added?Em |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-18 : 09:56:32
|
| Do you need to retrive the newly created records in every 5 mins? |
 |
|
|
Leila
Starting Member
5 Posts |
Posted - 2008-06-18 : 11:37:44
|
| No, I don't have a column that contains the time it was added.Actually, no, I don't need it to be retrived every 5 mns.What I want is something like this:Select Records that have been added the last t time.orSelect Records that have been added in the last insert statment.Is there anything able to retrieve records depending on such criteria?Thanks,Leïla |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-18 : 11:48:57
|
quote: Originally posted by Leila No, I don't have a column that contains the time it was added.Actually, no, I don't need it to be retrived every 5 mns.What I want is something like this:Select Records that have been added the last t time.orSelect Records that have been added in the last insert statment.Is there anything able to retrieve records depending on such criteria?Thanks,Leïla
You mean just after the insert? |
 |
|
|
|
|
|
|
|