Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #323

Re: Joining(?) question

From "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this>
Subject Re: Joining(?) question
Message-ID <nospam-E441FA.16272229102008@news.motzarella.org> (permalink)
Newsgroups comp.lang.java.databases
References <887f7e3b-2efe-403a-9028-cfbdb0c884fd@l62g2000hse.googlegroup
Date 2011-04-27 15:23 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases
In article 
<887f7e3b-2efe-403a-9028-cfbdb0c884fd@l62g2000hse.googlegroups.com>,
 mdR <mrafn@lakenet.com> wrote:

> On Oct 29, 10:22aam, RedGrittyBrick <RedGrittyBr...@spamweary.invalid>
> wrote:
> > mdR wrote:
[...]
> > SELECT BM.PARENT, BM.ITEM, IM.DESC
> > a aFROM BM, IM
> > a aWHERE IM.ITEM = BM.ITEM
> > a aAND 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
a from bm, im
a where im.item = bm.item
a 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 com
http://home.roadrunner.com/~jbmatthews/

---
 * 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 | Find similar


Thread

Re: Joining(?) question "John B. Matthews" <john.b..matthews@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000

csiph-web