Thread: Weird View behavior
I've got some wierd behavior with a view that I created.
devwindaily=# select version();
version
---------------------------------------------------------------------
PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66
(1 row)
version
---------------------------------------------------------------------
PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66
(1 row)
devwindaily=# \d email_num
View "email_num"
Attribute | Type | Modifier
-------------------+-------------+----------
user_emailaddress | varchar(50) |
email_count | integer |
View definition: SELECT user_info.user_emailaddress, count(user_info.user_emailaddress) AS email_count FROM user_info GROUP BY user_info.user_emailaddress;
View "email_num"
Attribute | Type | Modifier
-------------------+-------------+----------
user_emailaddress | varchar(50) |
email_count | integer |
View definition: SELECT user_info.user_emailaddress, count(user_info.user_emailaddress) AS email_count FROM user_info GROUP BY user_info.user_emailaddress;
devwindaily=# select * from email_num;
user_emailaddress | email_count
-------------------------+-------------
aaaa | 1
adfd@dkdk.com | 1
asfdasdfadsfafdsaf | 1
brady@windaily.com | 1
marcellus@chooseibs.com | 3
mbarrus@chooseibs.com | 1
mbarrus@swift-net.com | 1
vvv@sss.com | 1
xxxx | 1
(9 rows)
user_emailaddress | email_count
-------------------------+-------------
aaaa | 1
adfd@dkdk.com | 1
asfdasdfadsfafdsaf | 1
brady@windaily.com | 1
marcellus@chooseibs.com | 3
mbarrus@chooseibs.com | 1
mbarrus@swift-net.com | 1
vvv@sss.com | 1
xxxx | 1
(9 rows)
devwindaily=# select * from email_num where email_count > 1;
user_emailaddress | email_count
-------------------------+-------------
aaaa | 1
adfd@dkdk.com | 1
asfdasdfadsfafdsaf | 1
brady@windaily.com | 1
marcellus@chooseibs.com | 3
mbarrus@chooseibs.com | 1
mbarrus@swift-net.com | 1
vvv@sss.com | 1
xxxx | 1
(9 rows)
user_emailaddress | email_count
-------------------------+-------------
aaaa | 1
adfd@dkdk.com | 1
asfdasdfadsfafdsaf | 1
brady@windaily.com | 1
marcellus@chooseibs.com | 3
mbarrus@chooseibs.com | 1
mbarrus@swift-net.com | 1
vvv@sss.com | 1
xxxx | 1
(9 rows)
devwindaily=# select * from email_num where email_count < 2;
user_emailaddress | email_count
-------------------+-------------
(0 rows)
devwindaily=# select * from email_num where email_count < 1;
user_emailaddress | email_count
-------------------+-------------
(0 rows)
user_emailaddress | email_count
-------------------+-------------
(0 rows)
devwindaily=# select * from email_num where email_count = 1;
user_emailaddress | email_count
-------------------+-------------
(0 rows)
user_emailaddress | email_count
-------------------+-------------
(0 rows)
Now what is going on?!?!? That just plain old doesn't make sense!
Thanks for any help!
-Dan