[Users] Subselect does not wor

Friedrich Pape friedrich.pape at bsh.de
Fri Jan 13 04:44:55 PST 2006


Hi Nicolai,

Ingres supports subselect but the sql syntax is diffent.
here two short examples from sql reference manual Ingres R3

Subselects
Subselects are select statements placed in a where or having clause; the 
results
returned by the subselect are used to evaluate the conditions specified 
in the
where or having clause. Subselects are also referred to as subqueries.
Subselects must return a single column, and cannot include an order by 
or union
clause.
The following example uses a subselect to display all employees whose 
salary is
above the average salary:
select * from employees where salary >
(select avg(salary) from employees);
In the preceding example, the subselect returns a single value: the 
average salary.
Subselects can also return sets of values. For example, the following query
returns all employees in all departments managed by Barth.
select ename from employees where edept in
(select ddept from departments
where dmgr = 'Barth');

for more information look at 
http://opensource.ca.com/projects/ingres/documents


Nicolai Tufar schrieb:

> Greetings!
> 
> Am I wrong or is it a real limitation of Ingres. Subselect does not work
> when placed after FROM. Example:
> 
> CREATE TABLE X (Y INTEGER);
> SELECT * FROM (SELECT * FROM X) AS YYY;
>   E_US0845 Table 'select' does not exist or is not owned by you.
> 
> Every other database, even MySQL supports it. Is it true that Ingres does not
> support it?
> 
> Kindest regards,
> Nicolai Tufar
> _______________________________________________
> Users mailing list
> Users at ingres.ca.com
> http://ingres.ca.com/mailman/listinfo/users

-- 

MfG, Friedrich Pape
---------------------------------------------------------
  Bundesamt fuer Seeschifffahrt und Hydrographie  (BSH)
  Friedrich Pape (Z4305)
  Bernhard-Nocht-Str. 78	    Tel: +49 (0) 40 3190-2435
  20359 Hamburg		    Fax: +49 (0) 40 3190-5000
  http://www.bsh.de/            email: friedrich.pape at bsh.de
---------------------------------------------------------




More information about the Users mailing list