GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 96 of 171    Print  
Write query for the following questions

1. sql query for selecting alternate rows in a table

2. sql query for deleting alternate rows in a table

  
Total Answers and Comments: 7 Last Update: September 25, 2007     Asked by: lokesh 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 21, 2006 05:37:30   #1  
Sanjay Mungekar        

RE: Write query for the following questions

select * from emp where (rowid 0) in (select rowid mod(rownum 2) from emp)

select * from emp where (rowid 0) not in (select rowid mod(rownum 2) from emp)


 
Is this answer useful? Yes | No
August 30, 2006 02:03:09   #2  
krsihna        

RE: Write query for the following questions
the answer is at first i was inserted the data into the table with the use of this query we can get the even positions of records from that particular table
 
Is this answer useful? Yes | No
September 21, 2006 07:31:50   #3  
Arumugaraj        

RE: Write query for the following questions

When i run this query it shows error such as

'mod' is not a recognized function name'

why?


 
Is this answer useful? Yes | No
September 25, 2006 05:35:34   #4  
suresh.kandukuru Member Since: September 2006   Contribution: 3    

RE: Write query for the following questions
1)select empno from (select empno rownum rn from emp order by empno desc) it where mod(it.rn 2) 02)delete from emp where rowid in (select rd from (select empno rowid rd rownum rn from emp rder by empno desc) it where mod(it.rn 2) 0http://360.yahoo.com/suresh.kandukuru
 
Is this answer useful? Yes | No
January 01, 2007 04:57:52   #5  
bhumip        

RE: Write query for the following questions
For Alternating row (MS SQL)select id from stud a where (select count(*) from stud where a.id>id) 2 0
 
Is this answer useful? Yes | No
January 13, 2007 17:23:12   #6  
bku        

RE: Write query for the following questions
The query works fine but cant find the logic behind it...
 
Is this answer useful? Yes | No
September 25, 2007 12:09:17   #7  
kowmudiswarna Member Since: September 2007   Contribution: 21    

RE: Write query for the following questions

select*from emp where (rowid 1) in(select rowid mod(rownum 2) from emp);

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape