how to select 5 to 7 rows from a table, which contains 10 rows?

Answer Posted / ayyappanramachandran

You can achieve this by using following Query

select * from(select top 3 * from employees where
employeeid in(select top 7 employeeid from employees where
employeeid not in(select top 4 employeeid from employees
order by employeeid)))e order by employeeid.

Thanks
AyyappanRamachandran

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are different types of raid configurations? : SQL Server Architecture

565


What are the operating modes in which database mirroring runs?

598


How to create new table with "create table" statements?

550


What are drilldown reports?

84


What are the benefits and tasks of object explorer? : sql server management studio

605






Where can you find the error log information? : sql server database administration

558


What are the steps you must follow to hide sql server instances?

533


What is subreport?

96


What is stretch database in sql server?

559


What function does a database engine serve in the sql server?

564


What is query optimization process?

512


What is a cursor, index in sql?

566


What are window functions in sql server?

507


Explain the use of keyword with encryption. Create a store procedure with encryption?

533


What are the advantages of stored procedure in sql server?

460