Article View: borland.public.interbase.sql
Article #116Re: join to a table with different values in the same row
From: Isaac
Date: Fri, 06 Jun 2008 16:15
Date: Fri, 06 Jun 2008 16:15
30 lines
1931 bytes
1931 bytes
Wayne Niddery (TeamB) wrote: > "Isaac" <no@no.com> wrote in message > news:484865c2$1@newsgroups.borland.com... >> >> tabl1: inventories >> fields: inv_code, inv_name >> >> table2: items >> fields: inv_code, item_code, item_name >> >> table3: transfer_items >> fields: original_inv_code, item_code, new_inv_code(for new inventory) >> >> as you might guessed this is for transferring items quantities >> between inventories the sql I need is for table3 >> >> my question can I display two different inventories names in the same >> row with join ? if not please advice > > > Sure... > > select ti.original_inv_code, ti.item_code, ti.new_inv_code, > iold.item.name as old_inv_name, inew.item.name as new_inv_name, > inner join inventories iold on iold.inv_code = ti.original_inv_code > inner join inventories inew on inew.inv_code = ti.new_inv_code > ok I will try it thanks
Technical Details
Message-ID:
<4849635f@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<484865c2$1@newsgroups.borland.com> <4848a274$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,7e8a00cfc7e3cb68 X-Google-Attributes: gid114a0e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Fri, 06 Jun 2008 19:15:04 +0300 From: Isaac <no@no.com> User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 Newsgroups: borland.public.interbase.sql Subject: Re: join to a table with different values in the same row References: <484865c2$1@newsgroups.borland.com> <4848a274$1@newsgroups.borland.com> In-Reply-To: <4848a274$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 41.234.201.158 Message-ID: <4849635f@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1212769119 41.234.201.158 (6 Jun 2008 09:18:39 -0700) Lines: 30 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail