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


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

Re: Joining(?) question

From "RedGrittyBrick" <redgrittybrick@THRWHITE.remove-dii-this>
Subject Re: Joining(?) question
Message-ID <49087fa7$0$2921$fa0fcedb@news.zen.co.uk> (permalink)
Newsgroups comp.lang.java.databases
References <2c7507bc-5042-4e95-8571-2732f3c42832@8g2000hse.googlegroups.com>
Date 2011-04-27 15:23 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases

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

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