SQL: DISTINCT Clause
The syntax for the DISTINCT clause is:
SELECT DISTINCT columns
FROM tables
WHERE predicates;
Example #1: Let's take a look at a very simple example.
SELECT DISTINCT city FROM suppliers;This SQL statement would return all unique cities from the suppliers table.
Example #2: The DISTINCT clause can be used with more than one field.
For Example:SELECT DISTINCT city, state FROM suppliers;
This select statement would return each unique city and
state combination. In this case, the distinct applies to each field listed
after the DISTINCT keyword.
The DROP TABLE statement allows you to remove a table from the database.
The basic syntax for the DROP TABLE statement is:
DROP TABLE table_name;
This would drop table called supplier.
SQL: DROP TABLE Statement
The basic syntax for the DROP TABLE statement is:
DROP TABLE table_name;
For Example:
DROP TABLE supplier;This would drop table called supplier.
No comments:
Post a Comment