C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







how to get newly added records in sql server


Posted Date: 20 Jun 2007      Total Responses: 4

Posted By: satya       Member Level: Gold     Points: 2


Hi
in my table there is a ten records in this i want to get newly added five records . how to get it plz help me





Responses

Author: Altaf Hussain    20 Jun 2007Member Level: GoldRating:     Points: 2
Hi

If you have a column in which u save the date and time, then base ont the date and time u can retrieve the last five records ,




Author: Gopakumar    20 Jun 2007Member Level: GoldRating:     Points: 2
if u are using any autoincrement field or any id field then

select top 5% from tablename order by idfield desc


Author: rameshgoudd    20 Jun 2007Member Level: GoldRating:     Points: 2
Hi,
wat ever the records u wil enter,those wil be inserted in the database in a sequence manner...

so use the query to get top 5


ie select top5(id) from tablename orderby id desc.

Ramesh



Author: Victor Fernandez    06 Sep 2007Member Level: SilverRating:     Points: 2

Hi,

Select Top 1 * from TableName Order By UniqueID DESC

Regards

Victor


Post Reply
You must Sign In to post a response.
Next : Incorrect values in mdb how to correct it i need syntax
Previous : very urgent please
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design   Scripts

accuconference

Contact Us    Privacy Policy    Terms Of Use