Re: SELECT from multiple tables (not join though)

From: Madison Kelly <linux(at)alteeve(dot)com>
To: Madison Kelly <linux(at)alteeve(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT from multiple tables (not join though)
Date: 2005-01-10 17:30:37
Message-ID: 41E2BBBD.3010409@alteeve.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Typo, that should have been:

SELECT a.file_name, b.file_name, c.file_name FROM file_info_1 a,
file_info_2 b, file_info_3 c WHERE a.file_parent_dir='/' AND
b.file_parent_dir='/' AND c.file_parent_dir='/';

(All the WHERE... are the same)

Madison

Madison Kelly wrote:
> Hi all,
>
> I have another question, I hope it isn't too basic. ^.^
>
> I want to do a select from multiple tables but not join them. What I
> am trying to do is something like this (though this doesn't work as I
> need):
>
> SELECT a.file_name, b.file_name, c.file_name FROM file_info_1 a,
> file_info_2 b, file_info_3 c WHERE a.file_name='/' AND
> b.file_parent_dir='/' AND c.file_parent_dir='/';
>
> That returns every combination of the results from the three tables
> which is a huge number. What I need is to return all of the matches in
> all of the tables in a single column. Once I have all the matches in one
> column the next trick is to sort the combined results (any tips there?).
>
> I hope the question was clear. Please let me know if it wasn't. Thanks!
>
> Madison
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John Sidney-Woollett 2005-01-10 17:37:37 Re: SELECT from multiple tables (not join though)
Previous Message Bruno Wolff III 2005-01-10 17:23:42 Re: does "select count(*) from mytable" always do a seq