ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
Is it possible to delete duplicate rows in a table without 
using a temporary table ?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Is it possible to delete duplicate rows in a table without using a temporary table ?
Answer
# 1
Yes, it is possible by using in memory table variables on 
SQL server 2000 and above.

A table variable can be created and all disticnt values can 
be inserted into this table and then deleting all rows from 
first table you can insert back disticnt rows to back to 
original table. Table variable would automatically be 
destroyed whenever bacth execution finishes.

 
Is This Answer Correct ?    0 Yes 1 No
Ambuj Tayal
 
  Re: Is it possible to delete duplicate rows in a table without using a temporary table ?
Answer
# 2
using cursor is another option
 
Is This Answer Correct ?    0 Yes 0 No
Ghous
 
 
 
  Re: Is it possible to delete duplicate rows in a table without using a temporary table ?
Answer
# 3
sno         names 
1           arun
2           arun
3           arun
6           arun
7           bala
11          bala
12          guna
9           guna
14          guna
10          raj
13          raj

Table Name T1
Fields Names Sno,Names
Delete From t1 where sno not in 
(select min(sno) from t1 group by names)
 
Is This Answer Correct ?    2 Yes 0 No
Kumar
 
  Re: Is it possible to delete duplicate rows in a table without using a temporary table ?
Answer
# 4
Jaare Kameeney
 
Is This Answer Correct ?    0 Yes 0 No
Hakoona
 
  Re: Is it possible to delete duplicate rows in a table without using a temporary table ?
Answer
# 5
select * into #empnew from (select * from emp union select 
* from emp) a
 
Is This Answer Correct ?    1 Yes 0 No
Saravanan
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
How to Display, Amount of Disk Activity Generated by Transact-SQL Statements?  1
Which TCP/IP port does SQL Server run on?  2
What are the different ways of moving data/databases between servers and databases in SQL Server?  1
What is SQL server agent? SAP-Labs2
Which virtual table does a trigger use?  3
Plz tell about backup&recovery?  2
What is the appropriate number of test cases that you can write on a database? Microsoft1
What is the system function to get the current user's user id? HCL1
what is web server? Satyam3
What are the steps you will take, if you are tasked with securing an SQL Server? HCL1
About DTS usage ? Cognizent2
Let us say master db itself has no backup. Now you have to rebuild the db so what kind of action do you take?  1
What is the difference between login and a user? TCS5
What's the difference between a primary key and a unique key?  3
Wht is Stuff in sql ser  1
About types of indexes in SQL server ? Cognizent1
Explain some DBCC commands?  3
In performance wise distinct is good or group by is good? eg:select name from emp group by name; select distinct name from emp; Infosys2
what is cluster and nin-cluster index?  2
Can you have a nested transaction? HCL3
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com