pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: Difference between Access97 and PostgreSQL
2+ messages / 2 participants
[nested] [flat]
* Re: Difference between Access97 and PostgreSQL
@ 2002-02-01 00:29 Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Kings-Lynne @ 2002-02-01 00:29 UTC (permalink / raw)
To: Roberto Mello <rmello@cc.usu.edu>; Yan Bai <annie_job@hotmail.com>; +Cc: pgsql-sql
> On Wed, Jan 30, 2002 at 11:54:56PM +0000, Yan Bai wrote:
> >
> > --------------------------------------------------
> > SELECT temp.rating, temp.avgage
> > FROM (SELECT s.rating, AVG(s.age) as avgage
> > FROM sailors s GROUP BY s.rating) as temp
>
> Have you tried this query without the subselect? It looks like it should
> work.
What about this?
SELECT temp.rating, temp.avgage
FROM (SELECT s.rating, AVG(s.age) as avgage
FROM sailors s GROUP BY s.rating, s.age) as temp
Chris
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Difference between Access97 and PostgreSQL
@ 2002-02-01 10:15 Henshall, Stuart - WCP <SHenshall@westcountrypublications.co.uk>
0 siblings, 0 replies; 2+ messages in thread
From: Henshall, Stuart - WCP @ 2002-02-01 10:15 UTC (permalink / raw)
To: 'Josh Berkus' <josh@agliodbs.com>; Yan Bai <annie_job@hotmail.com>; pgsql-sql
> -----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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2002-02-01 10:15 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-02-01 00:29 Re: Difference between Access97 and PostgreSQL Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2002-02-01 10:15 Re: Difference between Access97 and PostgreSQL Henshall, Stuart - WCP <SHenshall@westcountrypublications.co.uk>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox