Write a query to delete duplicate records in SQL SERVER
Answer Posted / vijay
WITH INTER_TABLE(ROW, COL1) AS(
select row_number() over (partition by
COL1 order by COL1) as ROW ,COL1 from [TABLE_NAME]
)
Delete from INTER_TABLE where ROW > 1
| Is This Answer Correct ? | 22 Yes | 4 No |
Post New Answer View All Answers
explain different types of backups avaialabe in sql server? Given a particular scenario, how would you go about choosing a backup plan? : Sql server database administration
what is the difference between openrowset and openquery?
If any stored procedure is encrypted, then can we see its definition in activity monitor?
What is clustered index
What is an indexed view?
What are the different subsets of sql?
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?
Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?
How do I find the sql server version?
Is it possible to have clustered index on separate drive from original table location?
What is temporary table in sql server? Why we use temp table?
do you know how to configure db2 side of the application? : Sql server database administration
What is standby servers? Explain types of standby servers.
List out the different types of locks available in sql server?
What are the pros and cons of putting a scalar function in a queries select list or in the where clause?