Received: from mail_exchange.westcountrypublications.co.uk ([195.171.163.135]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g11AJBl35111 for ; Fri, 1 Feb 2002 05:19:11 -0500 (EST) (envelope-from SHenshall@westcountrypublications.co.uk) Received: by MAIL_EXCHANGE with Internet Mail Service (5.5.2650.21) id <1BL8VWQQ>; Fri, 1 Feb 2002 10:15:17 -0000 Message-ID: From: "Henshall, Stuart - WCP" To: "'Josh Berkus'" , Yan Bai , pgsql-sql@postgresql.org Subject: Re: Difference between Access97 and PostgreSQL Date: Fri, 1 Feb 2002 10:15:16 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Archive-Number: 200202/1 X-Sequence-Number: 6433 > -----Original Message----- > From: Josh Berkus [mailto:josh@agliodbs.com] > Sent: 31 January 2002 00:58 > To: Yan Bai; pgsql-sql@postgresql.org > Subject: Re: Difference between Access97 and PostgreSQL > > > Annie, > > > My question may out of the range of this forum. > > Well, yes. But, since I'm a nice guy, I'll answer your question even > though it does not relate to Postgres ... if you promise not to do it > again! In the future, send this question to a more appropriate list, > such as PSQL-ODBC, where they discuss Paotgres & MS Access. > > > When I run the following query under postgreSQL and Access2000, it > > works well. But Access97 cannot accept it. I got the error message > > as 'syntax error near FROM', it seems like in Access97, > there cannot > > have a subquery after 'FROM' > > > > -------------------------------------------------- > > SELECT temp.rating, temp.avgage > > FROM (SELECT s.rating, AVG(s.age) as avgage > > FROM sailors s GROUP BY s.rating) as temp > > -------------------------------------------------- > > > > You are exactly correct. MS Access 97 does not support sub-queires in > the FROM clause. THe only sub-queries supported by Access 97 are > sub-queries in the WHERE clause. With this sort of problem (I also vaguely recall ahving a problem with a union) I tend to make another query (as in an MS Access query that anyone else would call a view) and use it in the from clause. Cheers, - Stuart