Snippets / SQL / SELECT

SELECT

By Marcelo Fernandes Aug 9, 2017


SELECT * FROM customer


SELECT * FROM customer, orderinfo
    WHERE orderinfo.customer_id = customer.customer_id GROUP BY customer_id


SELECT customer.title, customer.fname, customer.lname,
 COUNT(orderinfo.orderinfo_id) AS "Number of orders"

FROM customer, orderinfo
 WHERE customer.customer_id = orderinfo.customer_id
 GROUP BY customer.title, customer.fname, customer.lname


Notes