Need to find records which match or unmatch with isd code

Hi all,
Having two tables
1. cdr
callingno                      calledno
9891567854                 8613548159929
9894562145                 8125642136545
9899546213                 8336547896322
8856521217                 8174456217789
2. ISD rates
code
  81
817
818
819
   82
   84
850
852
853
8536
855
  86
Requirements:
1] Matching records : Find records from cdr which matches isd code from isd rates table
it cound be
select cdr.callingno, cdr.calledno from cdr cdr, isdrates isd where (( substr(cdr.calledno,1,1) =isd.code) or ( substr(cdr.calledno,1,2) =isd.code) or ( substr(cdr.calledno,1,3) =isd.code) or
( substr(cdr.calledno,1,4) =isd.code))
output:
callingno                      calledno
9891567854                 8613548159929
9894562145                 8125642136545
8856521217                 8174456217789
2] Unmatching records:
output required:
callingno                      calledno
9899546213                 8336547896322
Kindly Help.

this?
with cdr(callingno,calledno) as (
select '9891567854','8613548159929' from dual union all
select '9894562145','8125642136545' from dual union all
select '9899546213','8336547896322' from dual union all
select '8856521217','8174456217789' from dual ),
isd(code) as(
select '81' from dual union all
select '817' from dual union all
select '818' from dual union all
select '819' from dual union all
select '82' from dual union all
select '84' from dual union all
select '850' from dual union all
select '852' from dual union all
select '853' from dual union all
select '8536' from dual union all
select '855' from dual union all
select '86' from dual )
select q.callingno,
       q.calledno,
       case when count(decode(m, 'MATCHED', 1)) > 0 then 'MATCHED' else 'UNMATCHED' end
  from (select t.callingno,
               t.calledno,
               case when (substr(t.calledno, 1, 4) like i.code || '%') then 'MATCHED' else 'UNMATCHED' end m
          from cdr t, isd i) q
group by q.callingno, q.calledno
CALLINGNO
CALLEDNO
CASEWHENCOUNT(DECODE(M,'MATCHE
9899546213
8336547896322
UNMATCHED
8856521217
8174456217789
MATCHED
9891567854
8613548159929
MATCHED
9894562145
8125642136545
MATCHED
Ramin Hashimzade

Similar Messages

  • TS1646 We have several apple devices in our family who use my debit card for itune charges.  I need to find out which device (itune account) these charges are coming from.  Can you help?

    We have several apple devices in our family who use my debit card for itune charges.  I need to find out which device (itune account) these charges are coming from. Can you help?

    You can't tell which device a purhcase was made on, but if your family members each have their own iTunes account to which your card is linked then you can check the purchase history on each of those accounts via the Store > View Account menu option on your computer's iTunes - that should have 'purchase history' section with a 'see all' link to the right of it

  • I have two copies of CS6 and I need to find out which serial number is installed on which computer. How do I find the serial number once it's installed on a computer?

    I have two copies of CS6 and I need to find out which serial number is installed on which computer. How do I find the serial number once it's installed on a computer?

    if they're pcs, Belarc Advisor - Free Personal PC Audit, for software, hardware and security configuration information on your computer.…

  • How to find out which list is associated with specific incoming email address

    Hey Guys,
    I've a received a request today from a user asking me which list was setup with a specific incoming email address.
    Is there a way to find out which list is associated with an email address?
    Thanks

    OK after a bit of research I found a way to achieve this.
    I simply looked up the email address in ADUC, then did a search in SP with the display name. I could locate the list and manually confirm it was configured with the incoming email address I was looking for.
    I also found the below script on Stackoverflow, but got "The 'using' keyword is not supported in this version of the language." when I tried to run it. Any idea how to fix that? I'd like to have a script to link a library to an email address istead of the
    manual approach described above.
    http://stackoverflow.com/questions/4974110/sharepoint-how-do-i-find-a-mail-enabled-list-if-i-only-have-the-email
    $SiteCollection = ""
    $EmailAddress = "" # only the part before the @
    # Load SharePoint module if not done yet
    if((Get-PSSnapin | Where {$_.Name -eq "Microsoft.SharePoint.PowerShell"}) -eq $null) {Add-PSSnapin Microsoft.SharePoint.PowerShell;}
    cls
    using System;
    using Microsoft.SharePoint;
    namespace FindListByEmail
    class Program
    {a
    static void Main(string[] args)
    string siteUrl = $SiteCollection;
    string email = $EmailAddress;
    using (SPSite site = new SPSite(siteUrl))
    foreach (SPWeb web in site.AllWebs)
    try
    foreach (SPList list in web.Lists)
    if (list.CanReceiveEmail)
    if (list.EmailAlias != null && list.EmailAlias.Equals(email, StringComparison.InvariantCultureIgnoreCase))
    Console.WriteLine("The email belongs to list {0} in web {1}", list.Title, web.Url);
    Console.ReadLine();
    return;
    finally
    if (web != null)
    web.Dispose();

  • How to find in which table field "DDTEXT" with entry "xyz"

    How to find in which table field "DDTEXT" with entry "Item number in contract account document" exists.
    There are too many tables with field name "DDTEXT"

    Refer:
    Getting short text of data element

  • Need to find out which application is making an frequent account lockout in AD

    Hi ,
    In my environment two of the user accounts are having an frequent account lockout.
    We have found that the account lockout was happening in their own machines with the help of the event logs in the domain controllers.
    Please tell us how do we find that which application on their machines are making an frequent account lock with the help of event logs else do we have some other options.
    All of your suggestions are much appreciated.
    Thanks & Regards S.Nithyanandham

    Usage of Microsoft ALtools( https://www.microsoft.com/en-us/download/details.aspx?id=18465 ):
    LockoutStatus application
     Run LockoutStatus.exe and choose File > Set target > Define “Target User Name”
    and “Target Domain Name”
    Tool will show you user with its “User State” (Locked/Not Locked), time when
    account was locked (Lockout Time) and will allow you to Unlock Account if you
    right click output string.
    EventCombMT application
     This tool gathers specific events from Windows event logs of single or several
    different servers to one central location.
     Run EventCombMT.exe > Right Click on “Select to search” field >Choose “Get DCs
    in Domain” > Mark your Domain Controllers for search> Select “Security” log file >
    Type “4740” in the “Event IDs” field > Choose “Success Audit” Event type > Click
    “Search” > Wait for “Matching Events Found” counter to show some values and
    click “Quit”
     In the opened window investigate file or files named by your domain controllers
    names. You should be able to determine the originating system where lockout
    happened by searching for “Caller Computer Name”
    Aloinfo application
     This tool has 2 purposes:
     To display all user account names and the age of their passwords run cmd >
    change directory to the one where ALtools were extracted > type @powershell >
    Enter > type “./aloinfo.exe /expires /server:DC | out-file C:\temp\expires.txt” >
    Enter
     To display credentials used for running services or for mapping network drives
    run cmd > change directory to the one where ALtools were extracted > type
    @powershell > Enter > type “./aloinfo.exe /stored | out-file C:\temp\stored.txt” >
    Enter
    You may also enable Netlogon logging on DC through command shell:
    nltest /dbflag:2080ffff
    Netlogon.txt file is created in %systemroot%/debug directory
    Just don't forget to turn it off after investigation :) nltest /dbflag:0
    Or you can use
    Netwrix Account Lockout Examiner to troubleshoot account lockouts, it's free.
    --- Jeff (Netwrix)

  • Need to fetch records which comes after in the sequence

    The data in the subject area is something like this:
    seq activity enddate
    1 Requirement Gathering 15-Feb-13
    2 Analysis 20-Feb-13
    3 Function Documentation 25-Feb-13
    4 Development 25-Mar-13
    5 Test 10-Apr-13
    6 Migration 15-Apr-13
    In the report I need to get the records which are after the boldAnalysis activity.
    Regards,
    Prem.

    Pardon if i had been confusing. Let me rephrase it.
    The requirement is to get all the Orders & their lines which have a particular item in their Order.
    Order Num line num Item desc
    101 1 Honey
    101 2 Bread
    102 1 Eggs
    102 2 Bread
    102 3 Eggs
    103 1 Eggs
    103 2 Honey
    How to get all the orders & order details which have item "Honey" in them?
    Regards,
    Prem.

  • HT1937 i need to find out which carrier my 3GS hot plz help someone IMEI: 012265001470520

    hey guys,
    ehm.. i wanted to find out how im gonna find out which carrier my Iphone 3GS got.
    so if anyone can help me out plz do
    my IMEI: 012265001470520
    i read thats gonna be find out with the imei so i posted it
    plz advice me fast

    Ask whomever originally purchased the phone.  There is no reliable way to tell otherwise - certainly none of your fellow Apple users here can tell you.
    P.S. if you are in the USA and the iPhone was purchased in the USA, it has to be AT&T.

  • I need to find out which processes in my labview programme are causing it to execute slowly?

    Basically, I require a program that takes readings from my apparatus every tenth of a second and writes it to my hard drive.  It starts fine but after 30 seconds or so it slows down to one reading per second.  My program is pretty lean but there must be something in there that is slowing it down.
    What can i use to to get a read-out of what processes my program is conducting and how long they take in order to find out what is cuasing delays in the execution?

    TommyP wrote:
    What can i use to to get a read-out of what processes my program is conducting and how long they take in order to find out what is cuasing delays in the execution?
    My guess is that your program does a lot of unecessary things. It would help if you could attach a simplified version of your code.
    How are you writing to the HD? (express VIs, storage VIs, lowlevel file IO, a new file with every write, appending to an existing file, etc. ? Binary file, formatted text, etc.)
    Do you keep the file open for the duration of the run or are you constanty opening and closing the file?
    How much data is in one "reading"? (bytes, kilobytes, megabytes ?)
    LabVIEW Champion . Do more with less code and in less time .

  • Need to find OS disks (restore) that came with a G5 single processor machi

    I need to find/buy the restore disks

    In US, contact Apple support via 800 number and they will sell you a set, around $50.

  • How to fetch the records which matches a partial value?

    Hi,
    I have a table called Employee which contains the following value in Category column
    ID Value
    1 Student,Staff
    2 Staff
    3 Parent,Student
    4 Member,Staff,Student
    I wanted to fetch only 1 and 3rd and 4th record since it matches the value Student.
    basically looking for the exact pattern matched with student separated by comma.
    how to perform this query. it would be great, if i get the query in MS Sql also.
    Edited by: Pannar on Nov 1, 2009 7:08 PM

    Hi,
    I'm sure the regexps will pass by, but here's a way (no idea if this will run in MS SQL, I'm not familiar with that):
    HO%xe> with employee as ( --generating your sample data:
    2  select 1 id, 'Student,Staff' category from dual union all
    3  select 2, 'Staff' from dual union all
    4  select 3, 'Parent,Student' from dual union all
    5  select 4 ,'Member,Staff,Student' from dual
    6  )
    7  --
    8  -- Actual query:
    9  --
    10  select id
    11  ,      category
    12  from   employee
    13  where  category like '%Student%'
    14  and    instr(category, ',')>0;
           ID CATEGORY
            1 Student,Staff
            3 Parent,Student
            4 Member,Staff,StudentYou can use UPPER or LOWER as well, if you want to be case-insensitive.
    edit
    Something like:
    MHO%xe> with employee as ( --generating your sample data:
      2  select 1 id, 'Student,Staff' category from dual union all
      3  select 2, 'Staff' from dual union all
      4  select 3, 'Parent,Student' from dual union all
      5  select 4 ,'Member,Staff,Student' from dual union all
      6  select 5, 'Student' from dual union all
      7  select 6, 'Student,' from dual
      8  )
      9  --
    10  -- Actual query:
    11  --
    12  select id
    13  ,      category
    14  from   employee
    15  where  regexp_like(category,',Student|Student,');
            ID CATEGORY
             1 Student,Staff
             3 Parent,Student
             4 Member,Staff,Student
             6 Student,Might work as well.
    Edited by: hoek on Nov 1, 2009 2:50 PM

  • Need to find out which apps were purchased previously (local copies lost)

    Rebuilding after losing the main HD on a MacBook (no, there was no backup, sigh). There were a few dozen iPhone apps, and the first iPhone sync wiped them from the iPhone. So we have no local list of purchased iPhone apps.
    Is there an easy way to find out from the App Store which apps have been purchased with an account in the past?
    Thanks

    in iTunes, go to the iTunes Store, on the right side of the store you have some "Quick Links", one is a link to your Account. There you can select your "Purchase History" and you see everything you were downloading... hope that helps

  • Need to find records posted from Fiori launchpad or Fiori application

    Hi,
    We have implemented Fiori Applications at our customer site now they want to identify or find out records posted from fiori launchpad and SAP ERP.
    Purpose of this activity to monitor the utilization of Fiori Application. Is anyone know how we can achieve this?
    Regards
    Shraddha

    Hi Sharddha,
    Please look at http://scn.sap.com/thread/3621724 and  http://scn.sap.com/thread/3336896
    It is better solution.
    Regards, Masa
    SAP Customer Experience Group - CEG

  • I need help finding out which web cam I own.

    I've had it since Christmas last year, and this year, I got a new computer. I put in my webcam and it said it didn't know what it was. Obviously, I need the drivers for it, but I don't even remember what kind of camera I got. I can take a picture of it with my camera and post what it looks like, but maybe you guys would know. It's white, and the circley-thingy right around the lens is grey.

    VF0220 is a Live! Cam Video IM, there are Windows XP and Vista drivers available in the download section.
    I have included the filenames for your reference.
    If you are running Windows Vista:
    Creative Live! Cam Video IM (VF0220) Driver v.03.02 (<FONT color=#222222 size=><B>2.48 MB</B>)
    Filename: LCVM_PCDRV_US__03_02.exe
    If you are running Windows XP, download this driver instead:
    Creative Live! Cam Video IM Driver .0.0.00 (<FONT color=#222222 size=><B>2.29 MB</B>)
    Filename: LCVM_PCDrv__0_0.EXE
    You can might want to download the Li've! Cam Center software too, it works on both OS.
    Creative Live! Cam Center 2.02.05 (<FONT color=#222222 size=><B>3.89 MB</B>)
    Filename: LCC_PCAPP_LA_2_02_05.exe
    Hope this helps.

  • Need to find the transport request no for a transaction code

    Hi to all experts,
    how can i find out the transport request for a transaction code

    Hi,
    - go to se10
    - on initial screen choose from applicaiton toolbar Transport Organizer Tools (a hammer icon)
    - choose Search for Objects in Requests/Tasks
    - on next screen in Object Selection frame type new object type (below Data Element), type in TRAN which denotes transaction
    - select checkbox next to it and type in transaction name you are looking for on the right
    - on the frame below check Modifiable and Released
    - run
    - you will get all request where this object (transaction) reside
    Regards
    Marcin

Maybe you are looking for

  • [b]HOW TO:[/b]  Copy and Paste THE Filename AND its PATH from Finder

    HOW TO DO THIS: Copy and Paste THE selected Filename AND its entire PATH from Finder to another application as in document footer reference, or document database which has a path field to aid in locating the file later. Finder, Spotlight and File Inf

  • Cannot delete Service Entry Sheet

    Dear Experts, Can please help me for the error encountered while deleting the Service Entry Sheet?  Error: Total takeoff quantity for (Service Entry Short Text) is getting < 0 . Processing not possible. Message: BOS01182 Thank you,

  • Best way to share library?

    Hey folks, I have my library (60+ gb) on a windows 2003 file share. I have my library set in the advanced settings on each client. I can access it fine from windows and mac clients but I have some complications. For instance, if I buy songs or rip CD

  • Very slow Undo/Redo Process !

    Hi, Upgraded to Logic 10.1 yesterday, on a Brand new Mac Pro ( 2015 ), 32GB Memory, 1 TB SSD, Everything seems to be running smoothly, EXCEPT ...!!! ( Capital Letters ) It's taking 15 seconds MINIMUM to Undo or Redo, Sometimes even a little longer !!

  • Loading the correct constructor from an init file...

    by reading lines like that: Apple 10 rgb000100255 Apple 20 rgb255150255 from an "init.txt" file but i get an IllegalArgumentException when it tries to find the correct constructor based on the paramTypes array, which contains the types of the paramet