Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.databases > #325
| From | "mdR" <mdr@THRWHITE.remove-dii-this> |
|---|---|
| Subject | Re: Joining(?) question |
| Message-ID | <1fe245d6-3222-4bfb-b2b2-bf16bdc98924@64g2000hsu.googlegroups.com> (permalink) |
| Newsgroups | comp.lang.java.databases |
| References | <nospam-E441FA.16272229102008@news.motzarella |
| Date | 2011-04-27 15:23 +0000 |
| Organization | TDS.net |
To: comp.lang.java.databases On Oct 29, 3:27 pm, "John B. Matthews" <nos...@nospam.invalid> wrote: > In article > <887f7e3b-2efe-403a-9028-cfbdb0c88...@l62g2000hse.googlegroups.com>, > > > > mdR <mr...@lakenet.com> wrote: > > On Oct 29, 10:22 am, RedGrittyBrick <RedGrittyBr...@spamweary.invalid> > > wrote: > > > mdR wrote: > [...] > > > SELECT BM.PARENT, BM.ITEM, IM.DESC > > > FROM BM, IM > > > WHERE IM.ITEM = BM.ITEM > > > AND BM.PARENT = 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 > from bm, im > where im.item = bm.item > and bm.parent = 1; > > Works with the Java database H2 <http://h2database.com/>. 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 = BM.ITEM WHERE BM.PARENT = 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
Back to comp.lang.java.databases | Previous | Next — Next in thread | Find similar
Re: Joining(?) question "mdR" <mdr@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: Joining(?) question "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: Joining(?) question "Lee Fesperman" <lee.fesperman@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: Joining(?) question "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
Re: Joining(?) question "Lee Fesperman" <lee.fesperman@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
csiph-web