[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Two Table Data comparision

Posted on 2011-09-03
4
Medium Priority
?
363 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
3 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 1000 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 1000 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 101

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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Suggested Courses

825 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