Re: very simple: How can I multiply tables?

From: Heiko Irrgang <irrgang(at)sc-networks(dot)de>
To: Postgres Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: very simple: How can I multiply tables?
Date: 2001-02-14 15:05:19
Message-ID: 20010214160519.D4774@sfear.sc-networks.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 14, 2001 at 05:49:01PM +0300, Mikhail V. Majorov wrote:
> Hi, question
>
> How can I multiply tables using SELECT?
>
> Table 1
>
> id surname
> --------------
> 1 AAA
>
> Table 2
>
> dt
> ---
> 12
>
> RESULT
>
> id surname dt
> ---------------------------
> 1 AAA 12

I think what you want is the following:
table1:
id surename
===========
1 AAA

table2:
id dt
=====
1 12

select table1.id as id, table1.surname as surname, table2.dt as dt from table1, table2 where table1.id = table2.id;

--
SC-Networks www: www.SC-Networks.de
Web Design, Netzwerke,
3D Animation und Multimedia
Heiko Irrgang Tel.: 08856/9392-00
Im Thal 2 Fax: 08856/9392-01

82377 Penzberg Mail: Irrgang(at)SC-Networks(dot)de

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fred Yankowski 2001-02-14 15:09:56 Re: Bad book review
Previous Message Ned Lilly 2001-02-14 15:00:52 Re: Crash-me of PostgreSQL