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 to find the second highest salary from emp table?

Answer Posted / chirag shah

select DISTINCT(salary) from emp order by salary desc limit 1,1

this limit gives you 2nd record
if you want 3rd value then write limit 3,1

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does oracle use sql?

990


how to return query output in html format? : Sql dba

1121


What is sql comments?

1116


explain mysql aggregate functions. : Sql dba

1032


What are conditional predicates?

1120


What is oracle sql developer?

1118


How to pronounce postgresql?

1096


What is the sql case statement?

1053


What is difference between table and view?

1134


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

975


How is debugging done?

1020


discuss about myisam key cache. : Sql dba

1068


What is the basic structure of an sql?

1155


Lookups are a key component in sql server integration services (ssis). Explain its purpose?

1054


Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

2163