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...

How One can easily select all even, odd, or Nth rows from a
table using SQL queries?

Answer Posted / mahesh

SIMPLE ODD AND EVEN...

SQL> SELECT ROWNUM FROM EMP GROUP BY ROWNUM HAVING MOD(ROWNUM,2)=1
2 /

ROWNUM
----------
1
3
5


1* SELECT ROWNUM FROM EMP GROUP BY ROWNUM HAVING MOD(ROWNUM,2)=0
2 /

ROWNUM
----------
2
4
Goahead...

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why should I use postgresql?

1023


How to fix oracle error ora-00942: table or view does not exist

1018


How many parts of a pl sql block are optional?

1138


how to use in conditions? : Sql dba

1015


What is the clause we need to add in function body to return variable?

1014


what is a composite primary key ? : Sql dba

1057


How much does a sql dba make? : SQL DBA

949


Which function is used to return remainder in a division operator in sql?

1147


Does a join table need a primary key?

958


How can you tell the difference between an index and a view?

937


What are sql functions? Describe the different types of sql functions?

1147


what is a tablespace? : Sql dba

1058


Mention what does the hierarchical profiler does?

1096


Do stored procedures prevent sql injection?

971


What are triggers and its types?

1074