GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  SQL
Go To First  |  Previous Question  |  Next Question 
 SQL  |  Question 102 of 192    Print  
consider that we r having table name emp....
now the question is
1.how should we print the odd rows from that table?
2.how should we print the rows where comm=NULL.

Reply ASAP

  
Total Answers and Comments: 8 Last Update: September 16, 2008     Asked by:  
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
January 24, 2007 23:44:39   #1  
shakthi Member Since: January 2007   Contribution: 3    

RE: consider that we r having table name emp.......
2. select * from tabname where comm=NULL;
 
Is this answer useful? Yes | No
January 30, 2007 05:21:31   #2  
Shri        

RE: consider that we r having table name emp.......
select rownum , ename ,empidfrom emp group by rownum,ename,empid having(mod(rownum,2) = 1);
 
Is this answer useful? Yes | No
January 30, 2007 17:41:17   #3  
srihari        

RE: consider that we r having table name emp.......
Display all records those commission is NULL

SELECT * FROM EMP WHERE comm IS NULL;

 
Is this answer useful? Yes | No
January 31, 2007 04:40:28   #4  
       

RE: consider that we r having table name emp.......
select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp)
 
Is this answer useful? Yes | No
February 10, 2007 02:11:59   #5  
ajitmelepat        

RE: consider that we r having table name emp.......
i think, the answer that has given by shakthi, won't work .try it : Select * from < table > where Comm is null .:)
 
Is this answer useful? Yes | No
February 28, 2007 13:13:46   #6  
csr        

RE: consider that we r having table name emp.......
HI

I am getting the correct result by using this query
select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp)

Can u differentiate rowid and rownum?

 
Is this answer useful? Yes | No
March 08, 2007 11:40:27   #7  
Kiran_kiran Member Since: March 2007   Contribution: 2    

RE: consider that we r having table name emp.......
hey i think this will help u

for odd rows

select *from (select rownum r,e.* from emp e) where mod(r,2)=1

 
Is this answer useful? Yes | No
September 16, 2008 09:34:48   #8  
vishnu vardhan reddy Member Since: September 2008   Contribution: 6    

RE: consider that we r having table name emp....now the question is 1.how should we print the odd rows from that table?2.how should we print the rows where comm=NULL.Reply ASAP
select  e.* from( select rownum rn ,ename,sal from emp) e
  where  mod(rn,2)=0

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape