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


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

Re: Joining(?) question

From "mdR" <mdr@THRWHITE.remove-dii-this>
Subject Re: Joining(?) question
Message-ID <f147db6f-8bd6-4cfd-86f7-79fcccad6b4a@y29g2000hsf.googlegroups.com> (permalink)
Newsgroups comp.lang.java.databases
References <49087fa7$0$2921$fa0fcedb@news.zen.co.uk>
Date 2011-04-27 15:23 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases
On Oct 29, 10:22 am, RedGrittyBrick <RedGrittyBr...@spamweary.invalid>
wrote:
> mdR wrote:
> > ~hey all
>
> > Looking for some assistance writing a SQL query (using Derby).  If
> > 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        2
> > 1        3
> > 4        9
> > 4        9
>
> > Table IM
> > --------------
> > ITEM   | DESC
> > --------------
> > 1        First
> > 2        Second
> > 3        Third
>
> > How to: Select all rows from BM where PARENT = 1 and supply IM.DESC to
> > ITEM column results.
>
> > to achieve this result...
> > -----------------------
> > PARENT  | ITEM | DESC
> > -----------------------
> > 1         2      Second
> > 1         3      Third
>
> > Is this possible?  Seems like I should be able to do this.
> > (Hope I explained this well enough!)
>
> SELECT BM.PARENT, BM.ITEM, IM.DESC
>    FROM BM, IM
>    WHERE IM.ITEM = BM.ITEM
>    AND BM.PARENT = 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

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Joining(?) question "mdR" <mdr@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
  Re: Joining(?) question "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
    Re: Joining(?) question "mdR" <mdr@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
    Re: Joining(?) question "mdR" <mdr@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000
      Re: Joining(?) question "=?ISO-8859-1?Q?Arne_Vajh=" <=?iso-8859-1?q?arne_vajh=@THRWHITE.remove-dii-this> - 2011-04-27 15:23 +0000

csiph-web