Asp.net Solution | sql tips

Here Reader, We are provide all question yhose asked in interview. you are read this blog and prepare for asp.net interview.

get only unique row and delete all duplicate row

delete from table1 where                
EmpID in(select cId from table1 group by cid having count(*) >1)
Posted by deepak at 11:22 pm No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: get only unique value in sql server

delete duplicate value in sql server

DELETE
FROM MyTable
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM MyTable
GROUP BY column1,
column)
Posted by deepak at 11:21 pm No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: delete duplicate value
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • Difference between SqlDataAdapter or sqlDataReader ?
     More Details :  Live Training in jaipur Ques.1 :  Difference between SqlDataAdapter or sqlDataReader ? Ans  :      1.A DataReader w...
  • What is a base class and derived class?
    A class is a template for creating an object. The class from which other classes derive fundamental functionality is called a base cla...
  • What is the difference between Finalize() and Dispose()?
    Dispose() is called by as an indication for an object to release any unmanaged resources it has held. Finalize() is use...
  • state management
     More Details :  Live Training in jaipur State management is the process by which you maintain state and page information over multip...
  • how to seach data in sqlDatabase
     More Details :  Live Training in jaipur   CREATE PROC SearchAllTables ( @ SearchStr nvarchar ( 100 ) ) AS BEGIN CREATE TABLE ...
  • What is Boxing/Unboxing?
     More Details :  Live Training in jaipur Boxing is used to convert value types to object. E.g. int x = 1; object obj = x ; Unb...
  • what is abstract class ?
     More Details :  Live Training in jaipur Abstract class is a class that can not be instantiated, it exists extensively for inheritance ...
  • What are events and delegates?
    An event is a message sent by a control to notify the occurrence of an action. However it is not known which object receives the event. F...
  • How to find duplicate values in a table or sql?
    With the SQL statement below you can find duplicate values in any table, just change the tablefield into the column you want to search and...
  • What is an Interface?
    An interface is a standard or contract that contains only the signatures of methods or events. The implementation is done in the class th...

Blog Archive

  • ▼  2014 (3)
    • ▼  April (2)
      • get only unique row and delete all duplicate row
      • delete duplicate value in sql server
    • ►  March (1)
  • ►  2013 (3)
    • ►  March (3)
  • ►  2012 (19)
    • ►  June (19)

About Me

deepak
View my complete profile
Simple theme. Powered by Blogger.