Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: JOIN !!

Re: JOIN !!

From: Alan Jwo <ajwo_at_gric.com>
Date: Thu, 19 Aug 1999 12:18:38 -0700
Message-ID: <MMYu3.166$F22.13753@sea-read.news.verio.net>


Hi Nandakumar:

   You didn't mention your table schema so I use the following two tables as an example:

TABLE_1: col1stores region, col2 stores state. TABLE_2: col1 stores state.county (two characters state code, then a dot, then county)

My SQL statement is like:
select t1.col1, t1.col2, substr(t2.col1, 4)

   from table1 t1, table t2
   where t1.col1 = substr(t2.col1, 1, 2)    order by 1;

Hope this helps.

Nandakumar wrote in message <7pfdj2$nfa$1_at_nnrp1.deja.com>...
>Hi
>
>This is a question in JOINs.
>
>There are two tables, one with REGION and STATE, and another with
>COUNTY. Each county in a state will start with the name of that state,
>like NY.XX,NJ.YY etc. (!! XX and YY are name of the counties)
>
>The goal is to join these two tables to list
>REGION, STATE, and COUNTY.
>
>I tried some queries with LIKE. But no rows are selected.
>If there is a solution to this other than using CURSORs, i would be
>interested in it.
>Thanks
>-
>Nandakumar
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Thu Aug 19 1999 - 14:18:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US