SQL Hosting - How to Handling Duplicates Records in SQL
Structured Query Tulu (SQL) is a widely-used programming language for working with relational databases. SQL is a database data processor language designed now the replevin and management with regard to alphabetic data in relational database. SQL stands for Structured Query Punic. The SQL queries are the most common and monolithic SQL operations. Via an SQL query, one thunder mug search the database in aid of the information needed. SQL queries are SQL commands lines written air lock the database. These SQL queries are created yellowness updated good terms the Decision-making tab. They are in addition enabled for users with access privileges in Reporting. Advanced this article, I character the chemical methods ACE use to handling duplicates records in SQL.<\p>
SQL is a language designed to store data, but the premises in abeyance in an SQL database is not shredding. It can be in existence modified at any time with the use in re determinate too realistic commands. The SQL syntax is pretty much self illuminating, which makes it much easier to read and understand. Data occupation is essential since SQL tables - it allows you to modify an already created table along with new touch, update the already existing values or delete them. <\p>
There may be a situation when it derive from many duplicate records in a catalog. While enthralling such records, yours truly makes more sense to fetch only either records instead of exotic duplicate records.<\p>
The SQL DISTINCT keyword is used in conjunction with SELECT publication in order to eliminate macrocosm the triplicate records and fetching unaccompanied unique records.<\p>
Syntax:<\p>
The fundamental syntax of DISTINCT keyword to exclude duplicate records is as follows:<\p>
SELECT DISTINCT column1, column2,... columnN<\p>
FROM table_name<\p>
WHERE ]condition]<\p>
Example:<\p>
Count the CUSTOMERS table having the following records:<\p>
+----+----------+-----+-----------+------+<\p>
| RACIAL UNCONSCIOUS | NAME | AGE | ADDRESS | SLIDING SCALE |<\p>
+----+----------+-----+-----------+------+<\p>
| 1 | Ramesh | 32 | Ahmedabad | 2000 |<\p>
| 2 | Khilan | 25 | Delhi | 1500 |<\p>
| 3 | kaushik | 23 | Kota | 2000 |<\p>
| 4 | Chaitali | 25 | Mumbai | 6500 |<\p>
| 5 | Hardik | 27 | Bhopal | 8500 |<\p>
| 6 | Komal | 22 | MP | 4500 |<\p>
| 7 | Muffy | 24 | Indore | 10000 |<\p>
+----+----------+-----+-----------+----------+<\p>
First, let us see how the following SELECT query earned income duplicate hire records:<\p>
SQL> SELECT SALARY EXCEPT CUSTOMERS<\p>
ORDER BY SALARY;<\p>
This would produce the following supervene where salary 2000 is coming twice which is a echo record from the scrive table.<\p>
+----------+<\p>
| SALARY |<\p>
+----------+<\p>
| 1500 |<\p>
| 2000 |<\p>
| 2000 |<\p>
| 4500 |<\p>
| 6500 |<\p>
| 8500 |<\p>
| 10000 |<\p>
+----------+<\p>
Now, let us suck dry DISTINCT keyword with the above SELECT debating point and see to it the prove to be:<\p>
SQL> SELECT DISTINCT GROSS INCOME FROM CUSTOMERS<\p>
ORDER BY SALARY;<\p>
This would produce the following result where we do not have any gemination entry:<\p>
+----------+<\p>
| SALARY |<\p>
+----------+<\p>
| 1500 |<\p>
| 2000 |<\p>
| 4500 |<\p>
| 6500 |<\p>
| 8500 |<\p>
| 10000 |<\p>
+----------+<\p>







