Solved

Two Table Data comparision

Posted on 2011-09-03
4
355 Views
Last Modified: 2012-08-14
Table I
==========
SL_NO      Phases
=========   ========
 6066      Phase I
6014      Phase II
6013      Phase III
6017      Phase IV
6016      Phase V



Table II
==========
SL_No      CALL_IN_NUMBER
=====          ================
1      606628347702
2      60177278738
3      601374244
4      60142444
5      60166621344
6      6066923847874



I am expecting that do a look up of Table II in Table in case pattern matches ex 1 row in table II matches with 1st row of table one hence Column C in table two to be filled with Phase I.
similarly 4th Row in Table II matches with row II in table I.


SL_No      CALL_IN_NUMBER      Col C
1      606628347702      Phase I
2      60177278738      Phase IV
3      601374244                            Phase III
4      60142444                            Phase II
5      60166621344      Phase V
6      6066923847874      Phase I


0
Comment
Question by:ratna1234
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 250 total points
ID: 36479537
select t2.sl_no, t2.call_in_number, t1. phases
from table1 t1, table2 t2
where table2.call_in_number like t1.sl_no || '%'

or, in ansi join syntax


select t2.sl_no, t2.call_in_number, t1. phases
from table1 t1 join table2 t2
on table2.call_in_number like t1.sl_no || '%'
0
 

Assisted Solution

by:arv_sab
arv_sab earned 250 total points
ID: 36486873
try


select SL_NO, CALL_IN_NUMBER, Phases Col C
from Table I, Table II
where substr(table II.CALL_IN_NUMBER,1,4)=Table I.SL_NO
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 36929486
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sum of columns in a row in oracle 3 44
date show only hh:mm 2 39
plsql job on oracle 18 78
Query - Duplicate dates with different activities counts 10 45
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question