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

1. How to fetch all the duplicate records from the table.

2. How to fetch the second highest salary from the table.

Answer Posted / sneha s

fetch duplicate records from table:
select column_name from table_name group by column_name having count(column_name)>1;

get the second highest salary:
select distinct salary from emp order by salary desc limit 1,1;

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 table constraint?

985


What is acid mean in sql server?

1110


How you can get the list of largest tables in a database?

1005


What are the differences between char and nchar in ms sql server?

1078


What is the difference between a local and a global temporary table?

1106


How can I check if a view exists in a sql server database?

1029


What is encryption key?

130


What does indexation mean?

968


What is the default fill factor value?

1073


How to create a view and a stored procedure in ms sql server using "create view/procedure" statements?

1004


Tell me when is the update_statistics command used?

1102


How to sort query output in descending order in ms sql server?

941


how would you write a sql query to compute a frequency table of a certain attribute involving two joins? What changes would you need to make if you want to order by or group by some attribute? What would you do to account for nulls?

1624


Why union all is faster than union?

906


What is buffer cash and log cache in sql server?

1112