Download Informix Guide to SQL: Tutorial
Transcript
Single-Valued Subqueries Query Result 3-28 order_num 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 Single-Valued Subqueries You do not need to include the keyword ALL or ANY if you know the subquery can return exactly one value to the outer-level query. A subquery that returns exactly one value can be treated like a function. This kind of subquery often uses an aggregate function because aggregate functions always return single values Query 3-29 uses the aggregate function MAX in a subquery to find the order_num for orders that include the maximum number of volleyball nets. Query 3-29 SELECT order_num FROM items WHERE stock_num = 9 AND quantity = (SELECT MAX (quantity) FROM items WHERE stock_num = 9) order_num 1012 3-32 Informix Guide to SQL: Tutorial Query Result 3-29
Related documents
Method and apparatus for computing device with status display
Informix Guide to SQL: Tutorial, Version 6.0
NEWERA - Interkyt
Informix Guide to SQL: Tutorial
In This Chapter
Informix Guide to Database Design and Implementation
IBM Informix Guide to SQL: Tutorial, Version 5.2
IBM Informix DB-Access User's Guide
Informix Guide to GLS Functionality, December 1999
Backup and Restore Guide for Informix Dynamic Server
Informix Backup and Restore Guide, December 1999
Informix Embedded SQL TP/XA Programmer`s Manual