write the query for find the top 2 highest salary in sql
server
Answer Posted / santosh kumar
select Top 1 salary from ( select top 2 salary from
emp_table order by salary desc)temptable order by salary
asc.
| Is This Answer Correct ? | 11 Yes | 12 No |
Post New Answer View All Answers
Write an SQL query to obtain the 2nd highest salary.
Can you explain various data region available in ssrs with their use?
This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?
How to transfer an existing table from one schema to another schema in ms sql server?
How to drop an existing stored procedure in ms sql server?
Define tempdb database?
When to use null data driven subscription?
What is snapshot report?
What are the types of normalization?
What is the ‘fillfactor’?
How can a user-defined datatype be created?
How to create a simple stored procedure in ms sql server?
What are sparse columns?
Define full outer join?
Why functions are used in sql server?