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

What is a unique constraint?

1008


What is a record in pl/sql?

1067


What is sap sql?

928


Can we perform dml on view?

974


What does a pl/sql package consist of?

928


how to run 'mysql' commands from a batch file? : Sql dba

1060


how to select unique records from a table? : Sql dba

1052


How do you take the union of two tables in sql?

931


What do you understand by pl/sql records?

959


What is primary and foreign key?

1014


Can we join tables without foreign key?

907


What is a temporal data type?

977


Is subquery faster than join?

950


How to write a query to show the details of a student from students table whose

936


What is the difference between join and natural join?

880