pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rodrigo Rezende <Rodrigo.Rezende@hortolandia.marelli.it>
To: pgsql-sql@postgresql.org
Subject: Select & Tables X Select & Views
Date: Fri, 18 Feb 2000 15:56:06 -0300
Message-ID: <38AD95C6.C8020910@hortolandia.marelli.it> (raw)

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




view thread (4+ messages)  latest in thread

Message-ID: <38AD95C6.C8020910@hortolandia.marelli.it>
Permalink:  ../38AD95C6.C8020910@hortolandia.marelli.it/
Also on:    postgresql.org/message-id/38AD95C6.C8020910@hortolandia.marelli.it

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: Rodrigo.Rezende@hortolandia.marelli.it
  Subject: Re: Select & Tables X Select & Views
  In-Reply-To: <38AD95C6.C8020910@hortolandia.marelli.it>
  References: <38AD95C6.C8020910@hortolandia.marelli.it>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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