Re: find the number of row for each tables

From: Jesus Aneiros <aneiros(at)jagua(dot)cfg(dot)sld(dot)cu>
To: Patrick Coulombe <11h11(at)videotron(dot)ca>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: find the number of row for each tables
Date: 2000-06-15 02:34:01
Message-ID: Pine.LNX.4.10.10006142228050.13322-100000@jagua.cfg.sld.cu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, 13 Jun 2000, Patrick Coulombe wrote:

> SELECT * from friends WHERE friends.f_id = strangers.s_id AND
> friends.categorie = 1
> ----------
> 80 rows

SELECT *
FROM friends F
WHERE friends.categorie = 1 AND EXISTS (SELECT *
FROM strangers
WHERE F.f_id = strangers.s_id);

> Can I just do 1 query and be able to find the number of row for each tables?

We have to use UNION.

Jesus.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Fred Lecul 2000-06-15 02:40:54 problems with table
Previous Message Constantino Martins 2000-06-14 22:54:06