Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: JOIN !!
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