Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

Two Table Data comparision

Posted on 2011-09-03
Medium Priority
361 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
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

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

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

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

Question has a verified solution.

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

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.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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 configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

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

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