UniqueRecords Property Example
The query in this example returns a list of customers from the Customers table who have at least one order in the Orders table.
Customers Table
Company name | Customer ID |
---|---|
Ernst Handel | ERNSH |
Familia Arquibaldo | FAMIA |
FISSA Fabrica Inter. Salchichas S.A. | FISSA |
Folies gourmandes | FOLIG |
Orders Table
Customer ID | Order ID |
---|---|
ERNSH | 10698 |
FAMIA | 10512 |
FAMIA | 10725 |
FOLIG | 10763 |
FOLIG | 10408 |
The following SQL statement returns the customer names in the following table:
SELECT DISTINCTROW Customers.CompanyName, Customers.CustomerID
FROM Customers INNER JOIN Orders
ON Customers.CustomerID = Orders.CustomerID;
Customers returned | Customer ID |
---|---|
Ernst Handel | ERNSH |
Familia Arquibaldo | FAMIA |
Folies gourmandes | FOLIG |