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

Showing Answers 1 - 27 of 27 Answers

Shri

  • Jan 30th, 2007
 

select rownum , ename ,empidfrom emp group by rownum,ename,empid having(mod(rownum,2) = 1);

  Was this answer useful?  Yes

srihari

  • Jan 30th, 2007
 

Display all records those commission is NULL
SELECT * FROM EMP WHERE comm IS NULL;

  Was this answer useful?  Yes

Guest

  • Jan 31st, 2007
 

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

  Was this answer useful?  Yes

ajitmelepat

  • Feb 10th, 2007
 

i think, the answer that has given by shakthi, won't work .try it : Select * from < table > where Comm is null .:)

  Was this answer useful?  Yes

csr

  • Feb 28th, 2007
 

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?

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions