Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f55JOcE58590 for ; Tue, 5 Jun 2001 15:24:38 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4UBwCE34893 for ; Wed, 30 May 2001 07:58:12 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f4UBfcp51097 for pgsql-sql@postgresql.org; Wed, 30 May 2001 07:41:38 -0400 (EDT) (envelope-from news) From: limorr@scepia.com (limlim) X-Newsgroups: comp.databases.postgresql.sql Subject: sql hard question Date: 30 May 2001 04:41:24 -0700 Organization: http://groups.google.com/ Lines: 12 Message-ID: <875516e7.0105300341.1ae6545b@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-support@google.com To: pgsql-sql@postgresql.org X-Archive-Number: 200106/42 X-Sequence-Number: 3251 i am trying to build a query in sql that compares between 2 tables one hold to field and the other hold the 2 fields in one example: table1:EN,12 table2:EN.12 how can i compare between the tables throw that field i try with this query but it doesnt work: SELECT * FROM dbo.CNT_DOC_LANGS x INNER JOIN dbo.CNT_DOCS2QUEST y ON (CAST(x.DOC_ID AS varchar) + '.' + RTRIM(x.LANG)) t = y.SRC_ID please help