Select & Tables X Select & Views

From: Rodrigo Rezende <Rodrigo(dot)Rezende(at)hortolandia(dot)marelli(dot)it>
To: pgsql-sql(at)postgresql(dot)org
Subject: Select & Tables X Select & Views
Date: 2000-02-18 18:56:06
Message-ID: 38AD95C6.C8020910@hortolandia.marelli.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mohit Marwaha 2000-02-19 07:26:22
Previous Message Ross J. Reedstrom 2000-02-18 18:26:31 Re: [SQL] Select & Tables X Select & Views