Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Display Odd/ Even number of records?

Answers were Sorted based on User's Feedback



Display Odd/ Even number of records?..

Answer / nishi

Select rownum,empno,ename,salary from emp group by rownum,empno,ename,salary having Mod(rownum,2)=0 -- To display EVEN records.

Select rownum,empno,ename,salary from emp group by rownum,empno,ename,salary having Mod(rownum,2)=1 -- To display ODD records.

Is This Answer Correct ?    4 Yes 0 No

Display Odd/ Even number of records?..

Answer / swastik mohanty

--TO FIND EVEN NUMBER
SELECT * FROM Table
WHERE ROWID IN (SELECT DECODE(MOD(ROWNUM, 2), 0, ROWID, NULL) FROM Table);
--TO FIND ODD NUMBER
SELECT * FROM Table
WHERE ROWID IN (SELECT DECODE(MOD(ROWID, 2), 1, ROWID, NULL) FROM Table);

Is This Answer Correct ?    2 Yes 0 No

Display Odd/ Even number of records?..

Answer / shareef

select * from emp where (rowid,0) in(select rowid,mod(rownum,2) from emp);---even


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

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Oracle General Interview Questions

List out the types of joins.

0 Answers  


How do you bind variables in oracle?

0 Answers  


What are the trigger associated with image items ?

1 Answers   Oracle,


ABOUT IDENTITY?

0 Answers   HCL,


What is connection pooling in oracle?

0 Answers  


How to assign values to data fields in record variables?

0 Answers  


In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?

1 Answers  


What are ACID properties in databases?

1 Answers  


Explain what are the characteristics of data files?

0 Answers  


How to convert characters to numbers in oracle?

0 Answers  


What privilege is needed for a user to create indexes in oracle?

0 Answers  


Can you create a synonym without having a table?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)