Kbase P110491: Does the Progress SQL-92 Engine support sub-SELECT queries?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  29/08/2008 |
|
Status: Verified
GOAL:
Does the Progress SQL-92 Engine support sub-SELECT queries?
GOAL:
Does the Progress SQL-92 Engine support subSELECT?
GOAL:
Does the Progress SQL-92 Engine support a query expression in the SELECT list?
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
All Supported Operating Systems
FIX:
Yes, the Progress SQL-92 Engine does support SubSelect queries in the WHERE clause of a SQL query.
For example:
SELECT customer.custnum, customer.name FROM pub.customer
WHERE customer.salesrep = (SELECT salesrep.salesrep FROM pub.salesrep WHERE salesrep.repname = 'Donna Swindall');
However, Progress SQL-92 does not support SubSelects when using them in the SELECT list.
For example:
SELECT customer.name, (SELECT COUNT(*) FROM pub.customer) FROM pub.customer;
In this case, one can use a derived table in the FROM list to accomplish the same results. For instance:
SELECT customer.name, derived_tbl.my_count FROM pub.customer, (SELECT COUNT(*) FROM pub.customer) AS derived_tbl (my_count);
Working example for UPDATE statement against sports2000 database:
UPDATE Orderline
SET (Itemnum) =
(SELECT Itemnum
FROM Item
WHERE Itemname = 'Tennis balls')
WHERE Ordernum = 20;