ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
how to find the particular row in table?(means suppose one 
table contain 10 rows , in these 10 rows how to find the 
particular row(example in 10 rows i want 5 row how)?
 Question Submitted By :: Somavenki
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?
Answer
# 1
SELECT TOP 5 column FROM table
ORDER BY NEWID()
 
Is This Answer Correct ?    7 Yes 13 No
Ritu Saini
 
  Re: how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?
Answer
# 2
set rowcount 5

select * from table_name
 
Is This Answer Correct ?    2 Yes 5 No
Ashim Pal
 
 
 
  Re: how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?
Answer
# 3
select top5 * from table
minus
select top4 from table
 
Is This Answer Correct ?    4 Yes 5 No
Sruthi
 
  Re: how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?
Answer
# 4
SELECT TOP 1 Empid  
    FROM (SELECT DISTINCT TOP 6 Empid FROM Employees ORDER
BY Empid desc) a  ORDER BY Empid asc
 
Is This Answer Correct ?    2 Yes 2 No
Senthilkumar
 
  Re: how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?
Answer
# 5
select top 1 * from table_name where id in(select top 5 id 
from table_name order by desc)
 
Is This Answer Correct ?    2 Yes 2 No
Guest
 
  Re: how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?
Answer
# 6
select top 1 * from  table_name
where id in (select top 5 id from table_name order by id asc)
order by id desc
 
Is This Answer Correct ?    0 Yes 2 No
Kishor
 
  Re: how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?
Answer
# 7
all the answers are wrong,the questions is  like this there 
are 100 rows they want o/p to display is in betwwen 50 and 
100 are displayed


      select top 100 * from  tablename where empid not in( 
select top 50 empid from  TABLENAME)
 
Is This Answer Correct ?    0 Yes 0 No
Uma
 
  Re: how to find the particular row in table?(means suppose one table contain 10 rows , in these 10 rows how to find the particular row(example in 10 rows i want 5 row how)?
Answer
# 8
this is uma sorry the above is wrong.


pls the is the correct answer ,i have this answer

declare cursor on table ,after that open the cusor and 
using "fetch" keyword we retrive any row ,and we have 
remove the cursor explictly because it is stored in the 
memory pls use dellocate keyword


declare cursou_emp2 insensitive scroll cursor for select * 
from empdetails [for{readonly}]

open cursou_emp2


fetch absolute 15 from cursou_emp2


deallocate cursou_emp2




it will display 15th row, if u wnt any row u chnage instead 
of 15
 
Is This Answer Correct ?    1 Yes 0 No
Uma
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
When you first load SQL SERVER you will startup with what all databases? CompuSol3
We create an index to fast the search. How it fast the query? Do we write any special keyword with query?  3
What is the use of MOVE keyword in restore command IBM2
How are SQL Server databases physically stored under Windows 2000?  1
What is the difference between OLEDB and ODBC CFCI3
What are the types of backup and tell me the difference between full and differential backup? TCS3
What all db objects can be found in MSDB database of a SQL Server instance? Accenture1
How can your resolve deadlocks? IBM3
how many types of store procedre in sqlserver 2000? ATI2
How to Get the last identity value used  4
What is difference between Triggers and store procedure?  2
What is the STUFF function and how does it differ from the REPLACE function?  2
what is differece between union and union all  4
What's the difference between a primary key and a unique key? Wipro8
Table student containing 2 columns,Join date,Employee name. Under join date 4 rows r ter =1-jan-2008,2-feb-2008,3-mar- 2008,4-feb-2008.Under Employee name 4 difeerent names jaison,robin,binoy,rahul Result set is, Table containing 4-column name=jan,feb,mar,april,,beneath these months count is given as 1,2,1,0 means these counts representing number of emplooyees joined in a month(january 1employee,february 2 employee,march 1 employee,april 0 employee) Can you give me the required sql query Wipro3
How do I compare two values when one value(data type) is char and the other is an integer?  3
How do we rollback the table data in SQL Server  3
What is indexed views? plz explain with example?  1
Wht is Stuff in sql ser  1
I am having table Title with TITLE id,Author ID, Publiser ID , table AUTHOR with Author ID, Author Name, table PUBLISER with Pub ID, Pub name Here hot to find out the publiser id who have relesed the books of patriticular author?  3
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com