Home | Previous Page | Next Page   Appendix B. Demonstration SQL > SQL Files for the Relational Database Model >

sel_all.sql

The following example command file contains all seven SELECT statement clauses that you can use in the Informix implementation of interactive SQL. This SELECT statement joins the orders and items tables. It also uses display labels, table aliases, and integers as column indicators; groups and orders the data; and puts the results into a temporary table.

SELECT o.order_num, SUM (i.total_price) price,
     paid_date - order_date span
   FROM orders o, items i
   WHERE o.order_date > '01/01/90'
      AND o.customer_num > 110
      AND o.order_num = i.order_num
   GROUP BY 1, 3
   HAVING COUNT (*) < 5
   ORDER BY 3
   INTO TEMP temptab1;
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]