Tag Archives: SQL

SQL

Finding Duplicates with SQL

Here’s query for finding duplicates in a table. Suppose you want to find all Usernames values in a table that exist more than once:


SELECT Username, COUNT(Username) AS NumOccurrences
FROM   Users
GROUP BY Username
HAVING      (COUNT(Username) > 1)

Microsoft SQL Server Transact-SQL

Insert Multiple Rows in SQL Server

In SQL Server 2005, in order to insert 3 rows to a table, you had to run 3 INSERT statements:

insert into Customers (Name, City, Phone) values (‘Customer #1’, ‘Jerusalem’, ‘2343245’)

insert into Customers (Name, City, Phone) values (‘Customer #2’, ‘Tel Aviv’, ‘0987345’)

insert into Customers (Name, City, Phone) values (‘Customer #3’, ‘Haifa’, ‘275466’)

In SQL Server 2008, you can insert multiple rows in a single insert statement that takes a number of value arrays:

insert into Customers (Name, City, Phone)

values

(‘Customer #1’, ‘Jerusalem’, ‘2343245’),

(‘Customer #2’, ‘Tel Aviv’, ‘0987345’),

(‘Customer #3’, ‘Haifa’, ‘275466’)

Source link

MySQL Open Source SQL Utils

SQLyog – GUI Tool for MySQL

  • The leading Free and Open Source MySQL GUI Tools for the last 5 years
  • Uses Native C MySQL Client – the fastest way to access MySQL

Enterprise Version vs Community version

Homepage: http://www.webyog.com