pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedusing WHERE and AND in SELECT
2+ messages / 2 participants
[nested] [flat]
* using WHERE and AND in SELECT
@ 2017-06-08 12:12 Jean-Yves MARTIN <Jean-Yves.Martin@ec-nantes.fr>
2017-06-08 14:10 ` Re: using WHERE and AND in SELECT Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Jean-Yves MARTIN @ 2017-06-08 12:12 UTC (permalink / raw)
To: pgsql-bugs
Hi,
We had an issue when writing a SELECT request : we write:
select personne_id from personne inner join conducteur on (conducteur.personne_id=personne.personne_id) and personne.personne_id<20
instead of:
select personne_id from personne inner join conducteur on (conducteur.personne_id=personne.personne_id) where personne.personne_id<20
and there is no syntax error. both give the same result.
is it a bug in the SQL grammar or is it a usable syntax?
regards,
JY Martin.
Jean-Yves MARTIN
Responsable Option Informatique
Dept Informatique et Mathématiques
Centrale Nantes
1 rue de la Noë
44321 Nantes, cedex 3
France
Tel: +33 2 40 37 25 98
Mail: Jean-Yves.Martin@ec-nantes.fr <mailto:Jean-Yves.Martin@ec-nantes.fr>
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: using WHERE and AND in SELECT
2017-06-08 12:12 using WHERE and AND in SELECT Jean-Yves MARTIN <Jean-Yves.Martin@ec-nantes.fr>
@ 2017-06-08 14:10 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2017-06-08 14:10 UTC (permalink / raw)
To: Jean-Yves MARTIN <Jean-Yves.Martin@ec-nantes.fr>; +Cc: pgsql-bugs
Jean-Yves MARTIN <Jean-Yves.Martin@ec-nantes.fr> writes:
> We had an issue when writing a SELECT request : we write:
> select personne_id from personne inner join conducteur on (conducteur.personne_id=personne.personne_id) and personne.personne_id<20
There's no requirement for parentheses around the JOIN condition,
so that's perfectly legal.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2017-06-08 14:10 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-06-08 12:12 using WHERE and AND in SELECT Jean-Yves MARTIN <Jean-Yves.Martin@ec-nantes.fr>
2017-06-08 14:10 ` Tom Lane <tgl@sss.pgh.pa.us>
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