Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

wat will be the sql query to extract only last 3 records
from table supose table hving thousands for records

Answer Posted / pawan k. dubey

1-select * from employee where emp_id >(select count(*)-3
from employee)

2-select * from employee where emp_id in
(
select top 3 emp_id from employee order by emp_id DESC

)

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you think of this implementation? Can this be implemented better?

945


What is a covering index?

984


Can we linked SharePoint to a SQL database?

1028


can you implement data mining in SSRS?

148


What is normalization of database?

1105


How to provide default values to function parameters?

1139


Do you know what are different types of replication in sql server?

1099


Explain rdbms?

1039


What is the difference between web edition and business edition?

111


What is the latest version of microsoft sql server?

1047


What happens to a trigger with multiple affected rows?

945


How to find a value in another dataset based on current dataset field (ssrs 2008 r2)?

169


What is bcp? When does it use?

943


What are scheduled tasks in sql server?

1085


How you can move data or databases between servers and databases in sql server?

1050