Select & Tables X Select & Views - Mailing list pgsql-sql

From Rodrigo Rezende
Subject Select & Tables X Select & Views
Date
Msg-id 38AD95C6.C8020910@hortolandia.marelli.it
Whole thread Raw
Responses Re: [SQL] Select & Tables X Select & Views  ("Ross J. Reedstrom" <reedstrm@wallace.ece.rice.edu>)
List pgsql-sql
Hello all!,

Using the following query :
select * from taba, tabb;


The result will be taba's number of rows * tabb's number of rows
result = rows(taba) * rows(tabb)

1.ex.:

taba :
1
2
3

tabb
a
b

select * from taba, tabb; :
1 | a
2 | a
3 | a
1 | b
2 | b
3 | b

This occurred because I didn't use the clause Join and Where...

But, using a View instead of tabb(table), the number of rows was the
same of the view

2. ex.:
taba :
1
2
3

viewb
a
b

select * from taba, viewb; :

1 | a
1 | b

Why this occurred? I would like this second example returned the same as
the first

Thanks a lot,

Rodrigo C. Rezende



pgsql-sql by date:

Previous
From: "Mohit Marwaha"
Date:
Subject: Kindly stop sending please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: [SQL] Select & Tables X Select & Views