Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "mdR" Subject: Re: Joining(?) question Message-ID: <1fe245d6-3222-4bfb-b2b2-bf16bdc98924@64g2000hsu.googlegroups.com> X-Comment-To: comp.lang.java.databases Newsgroups: comp.lang.java.databases In-Reply-To: wrote: > In article > <887f7e3b-2efe-403a-9028-cfbdb0c88...@l62g2000hse.googlegroups.com>, > > > > =A0mdR wrote: > > On Oct 29, 10:22=A0am, RedGrittyBrick > > wrote: > > > mdR wrote: > [...] > > > SELECT BM.PARENT, BM.ITEM, IM.DESC > > > =A0 =A0FROM BM, IM > > > =A0 =A0WHERE IM.ITEM =3D BM.ITEM > > > =A0 =A0AND BM.PARENT =3D 1 > [...] > > hmm... that didn't work. I'll look for a SQL group... thanks again > > create table bm (parent integer, item integer); > insert into bm values(1,2); > insert into bm values(1,3); > insert into bm values(4,8); > insert into bm values(4,9); > > create table im (item integer, desc varchar(10)); > insert into im values(1,'First'); > insert into im values(2,'Second'); > insert into im values(3,'Third'); > > select bm.parent, bm.item, im.desc > =A0 from bm, im > =A0 where im.item =3D bm.item > =A0 and bm.parent =3D 1; > > Works with the Java database H2 . I'm not > familiar with Derby, other than its Java heritage. Do you need an > explicit JOIN clause? > > -- > John B. Matthews > trashgod at gmail dot comhttp://home.roadrunner.com/~jbmatthews/ I was too quick on the previous reply... I simply pasted the reply into the query. yes, it works now. (sorry RGB) SELECT BM.PARENT, BM.ITEM, IM.DESC FROM BM JOIN IM ON IM.ITEM =3D BM.ITEM WHERE BM.PARENT =3D 1; -mark --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24