Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "mdR" Subject: Re: Joining(?) question Message-ID: X-Comment-To: comp.lang.java.databases Newsgroups: comp.lang.java.databases In-Reply-To: <49087fa7$0$2921$fa0fcedb@news.zen.co.uk> References: <49087fa7$0$2921$fa0fcedb@news.zen.co.uk> Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 63 Date: Wed, 27 Apr 2011 15:23:03 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303917783 96.60.20.240 (Wed, 27 Apr 2011 10:23:03 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:23:03 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.databases:321 To: comp.lang.java.databases On Oct 29, 10:22=A0am, RedGrittyBrick wrote: > mdR wrote: > > ~hey all > > > Looking for some assistance writing a SQL query (using Derby). =A0If > > anyone could help I would appreciate it. > > I am having trouble wrapping my head around the query syntax needed to > > do the following... > > > Given the following tables: > > > Table BM > > ------------------------ > > PARENT | ITEM > > ------------------------ > > 1 =A0 =A0 =A0 =A02 > > 1 =A0 =A0 =A0 =A03 > > 4 =A0 =A0 =A0 =A09 > > 4 =A0 =A0 =A0 =A09 > > > Table IM > > -------------- > > ITEM =A0 | DESC > > -------------- > > 1 =A0 =A0 =A0 =A0First > > 2 =A0 =A0 =A0 =A0Second > > 3 =A0 =A0 =A0 =A0Third > > > How to: Select all rows from BM where PARENT =3D 1 and supply IM.DESC t= o > > ITEM column results. > > > to achieve this result... > > ----------------------- > > PARENT =A0| ITEM | DESC > > ----------------------- > > 1 =A0 =A0 =A0 =A0 2 =A0 =A0 =A0Second > > 1 =A0 =A0 =A0 =A0 3 =A0 =A0 =A0Third > > > Is this possible? =A0Seems like I should be able to do this. > > (Hope I explained this well enough!) > > SELECT BM.PARENT, BM.ITEM, IM.DESC > =A0 =A0FROM BM, IM > =A0 =A0WHERE IM.ITEM =3D BM.ITEM > =A0 =A0AND BM.PARENT =3D 1 > > This is an SQL question not a Java question - I would not have posted it > here. > > -- > RGB thanks, I'll give that a try good point... wasn't thinking :) -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