Received: from linux2.johnmckown.net (adsl-64-216-0-33.dsl.eulstx.swbell.net [64.216.0.33]) by hub.org (8.10.1/8.10.1) with ESMTP id e9A0GQJ78563 for ; Mon, 9 Oct 2000 20:16:26 -0400 (EDT) Received: from linux2 (IDENT:pgsql@linux2 [192.168.151.21]) by linux2.johnmckown.net (8.10.1/8.10.1) with ESMTP id e9A0HqL28197; Mon, 9 Oct 2000 19:17:52 -0500 Date: Mon, 9 Oct 2000 19:17:52 -0500 (CDT) From: John McKown X-Sender: pgsql@linux2.johnmckown.net To: "Nema, Vivek" cc: "'pgsql-sql@postgresql.org'" Subject: Re: -query sql In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200010/99 X-Sequence-Number: 1761 On Tue, 3 Oct 2000, Nema, Vivek wrote: > Hi! > a small query may be u can help me. > i just wanted to compare 2 columns in 2 tables.how can i do it in sql > statement.i know it is possible somehow i am not able to write my query. > i am using RDB 6.0 > > Any pointer or help will be highly appreciated. > What is RDB? This list is for PostgreSQL. However, in general, suppose you have column1 in table1 and column2 in table2, you can select rows where they are equal by doing something like: SELECT table1.column1, table1.another, table2.thisone, FROM table1, table2 WHERE table1.column1=table2.column2; Change the information you want in the first line of the SELECT. I just made up some names. Hope this helps, John