Path: utzoo!attcan!uunet!mcvax!enea!kth!draken!serafim From: serafim@nada.kth.se (Serafim Dahl) Newsgroups: comp.databases Subject: Bug in INGRES?? Keywords: INGRES, SQL, Query Language Message-ID: <758@draken.nada.kth.se> Date: 20 Jan 89 12:27:05 GMT Organization: Royal Institute Of Technology, Stockholm, Sweden Lines: 19 where Emp=employee, sal=salary, mgr=manager, dept=department the following query: a) select avg(sal) from Emp where dept in (select dept from Emp where name = 'Smith') gives the answer '8383.333'. Examining the query, breaking it down as follows: b) Select dept from Emp where name='Smith'; (giving the answer 'food') select avg(sal) from Emp where dept='food'; gives the answer '7795.833'. It turns out that, in query a all duplicates in sal are eliminated, while in b they quite correctly are not eliminated. /serafim@nada.kth.se