SQL: Check For Duplicate Rows
SELECT email, COUNT(email) AS NumOccurrences FROM users GROUP BY email HAVING ( COUNT(email) > 1 )
12390 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
CornerBLUE, Inc. http://www.cornerblue.com
SELECT email, COUNT(email) AS NumOccurrences FROM users GROUP BY email HAVING ( COUNT(email) > 1 )
public static SqlDataReader GetReader(string Query) { string ConnectionString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings["CONNECTION_STRING_NAME"].ConnectionString; SqlConnection con = new SqlConnection(ConnectionString); SqlCommand command = new SqlCommand(); command.Connection = con; command.Connection.Open(); command.CommandText = Query; return command.ExecuteReader(); }
INSERT INTO TABLE2 (COL1, COL2, COL3) SELECT COL1, COL4, COL7 FROM TABLE1