today:
52
yesterday:
150
Total:
996,847

SQL SQL SELECT DISTINCT Statement

admin 2016.04.29 10:07 Views : 160

SELECT distinct c.CUSTOMER_ID , initcap(C.CUST_FIRST_NAME || ' ' || C.CUST_LAST_NAME)  Name, o.ORDER_ID, O.ORDER_TOTAL  
FROM DEMO_CUSTOMERS C, DEMO_ORDERS O, DEMO_ORDER_ITEMS I
where C.CUSTOMER_ID   = O.CUSTOMER_ID   and
      I.ORDER_ID = O.ORDER_ID


------------------------------------------------------

* SQL SELECT DISTINCT Statement

In a table, a column may contain many duplicate values; and sometimes you only want to list the different (distinct) values.

The DISTINCT keyword can be used to return only distinct (different) values.