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


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Query to fetch last 2 rows from the table


Posted Date: 19 Sep 2008    Resource Type: Code Snippets    Category: SQL

Posted By: Shivashankar Chincholi       Member Level: Gold
Rating:     Points: 5



//Query to fetch last 2 rows from the table

This sample code shows how to fetches last two rows from the table in a database.


select identity(int,1,1)as ID,* into #a from customer

select * from #a where ID > (select max(ID) from #a)-2







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Query to fetch last 2 rows from the table  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Substring in sql server stored procedure
Previous Resource: Use this query to implement SqlcacheDependency
Return to Discussion Resource Index
Post New Resource
Category: SQL


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

budget conference call

Contact Us    Privacy Policy    Terms Of Use