EasyManua.ls Logo

Sybase Adaptive Server Anywhere - Page 552

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
FROM clause
534
KEY JOIN sales_order
KEY JOIN sales_order_items
KEY JOIN product
...
The following query illustrates how to use derived tables in a query:
SELECT lname, fname, number_of_orders
FROM customer JOIN
( SELECT cust_id, count(*)
FROM sales_order
GROUP BY cust_id )
AS sales_order_counts ( cust_id,
number_of_orders )
ON ( customer.id = sales_order_counts.cust_id )
WHERE number_of_orders > 3

Table of Contents

Related product manuals