first post - Mailing list pgsql-sql

From Eric McKeown
Subject first post
Date
Msg-id 355D1AAA.E0F1C3CF@palaver.net
Whole thread Raw
List pgsql-sql
Hi there, folks.  This is my first post to this list, and I'm hoping I'm
posting to the right list from the Postgres page.  I looked at several
different ones, and this seemed to be the one most suited to this
question.

I'm using Postgresql version 6.3.1, and I'm trying to execute the
following query:


select make, model, price, yr, mileage, extcol, intcol, image from
usedcars where (make='Ford' or make='Lincoln' ) and (model='Continental
Executive' );

First results:
make|model|price|yr|mileage|extcol|intcol|image
----+-----+-----+--+-------+------+------+-----
(0 rows)

Next query:
select make, model, price, yr, mileage, extcol, intcol, image from
usedcars where (make='Lincoln' or make='Ford') and (model='Continental
Executive') ;

Results:
make   |model                |price|  yr|mileage|extcol|intcol
|image
-------+---------------------+-----+----+-------+------+------------+-----

Lincoln|Continental Executive|12000|1993|  69000|blue  |blue leather|
(1 row)

I thought these two queries were logically identical, so I don't quite
understand the differing results.  Finally, one more query.  I repeat
the first query, and:

 select make, model, price, yr, mileage, extcol, intcol, image from
usedcars where (make='Ford' or make='Lincoln') and (model='Continental
Executive') ;


make   |model                |price|  yr|mileage|extcol|intcol
|image
-------+---------------------+-----+----+-------+------+------------+-----

Lincoln|Continental Executive|12000|1993|  69000|blue  |blue leather|
(1 row)

Surprise!!!  Would anybody be able to offer me a clue on this
behavior??  I'm pretty stumped.

TIA...

eric
--
***********************************************************
Eric McKeown                              ericm@palaver.net
Palaver                              http://www.palaver.net
332 N. Market St.                    Phone:  (219) 253-8131
Monon, IN 47959                        Fax:  (219) 253-6800
***********************************************************



pgsql-sql by date:

Previous
From: "Sean"
Date:
Subject: New User -- PG features
Next
From: Oleg Broytmann
Date:
Subject: Re: [SQL] Duplicate rows