common to the appellants for 3 days from particular date

Need to find the number of other_party which is a common call for conseutive 3 days

Create table call (key id Number (15) not null, mobile_number number primary (10), other_party number (10), call_type varchar2 (10), the call_date_time date, number (15)) duration;


insert into values of the call (1,9818764535,9899875643, 'IN', to_date (24 May 12 02:10:43 "," dd-MON-yy hh24:mi:ss'), 10);
Insert in appeal values (2, 9818764535,9215478213, 'OUT', to_date (24 May 12 08:11:13 "," dd-MON-yy hh24:mi:ss'), 20);
Insert in appeal values (3, 9818764535,9899875643, 'IN', to_date (25 May 12 18:07:02 "," dd-MON-yy hh24:mi:ss'), 30);
insert into values of the call (4,9818764535,9012451785, 'IN', to_date (26 May 12 02:11:13 "," dd-MON-yy hh24:mi:ss'), 40);
Insert in appeal values (5, 9818764535,9215478213, 'IN', to_date (26 May 12 08:17:02 "," dd-MON-yy hh24:mi:ss'), 25);
Insert in appeal values (6, 9818764535,9899875643, 'OUT', to_date (26 May 12 20:21:04 ',' dd-MON-yy hh24:mi:ss'), 67);


Entry criteria:

Mobile phone number: 9818764535
date: 24 April 13

Output:


Other_party call_type time call_date_time
9899875643 IN 24 APRIL 13 02:10:43 10
9899875643 ON APRIL 25, 13 18:07:02 30
9899875643 ON 26 MAY 13 20:21:04 67

Published by: 983567 on May 2, 2013 03:51

Published by: 983567 on May 2, 2013 03:52

Hello

983567 wrote:
Need to find the number of other_party which is a common call for conseutive 3 days

Create table call (key id Number (15) not null, mobile_number number primary (10), other_party number (10), call_type varchar2 (10), the call_date_time date, number (15)) duration;

insert into values of the call (1,9818764535,9899875643, 'IN', to_date (24 April 13 02:10:43 "," dd-MON-yy hh24:mi:ss'), 10);
Insert in appeal values (2, 9818764535,9215478213, 'OUT', to_date (24 April 13 08:11:13 "," dd-MON-yy hh24:mi:ss'), 20);
Insert in appeal values (3, 9818764535,9899875643, 'IN', to_date (25 April 13 18:07:02 "," dd-MON-yy hh24:mi:ss'), 30);
insert into values of the call (4,9818764535,9012451785, 'IN', to_date (26 May 13 02:11:13 "," dd-MON-yy hh24:mi:ss'), 40);
Insert in appeal values (5, 9818764535,9215478213, 'IN', to_date (26 May 13 08:17:02 "," dd-MON-yy hh24:mi:ss'), 25);
Insert in appeal values (6, 9818764535,9899875643, 'OUT', to_date (26 May 13 20:21:04 ',' dd-MON-yy hh24:mi:ss'), 67);

AE there no set of 3 days of consctuive in the sample data.
Did you mean to say "APR" everywhere, you said 'MAY' above?

Entry criteria:

Mobile phone number: 9818764535
date: 24 April 13

Output:

Other_party call_type time call_date_time
9899875643 IN 24 APRIL 13 02:10:43 10
9899875643 ON APRIL 25, 13 18:07:02 30
9899875643 ON 26 MAY 13 20:21:04 67

Here's one way:

WITH     params     AS
(
     SELECT  9818764535          AS mobile_number
     ,     DATE '2013-04-24'     AS start_date
     FROM     dual
)
,     got_cnt          AS
(
     SELECT     c.*
     ,     COUNT (DISTINCT TRUNC (c.call_date_time))
              OVER ( PARTITION BY  p.mobile_number
                      ,                p.start_date
                  ,           c.other_party
                )     AS cnt
     FROM     params     p
     JOIN     call     c  ON   c.mobile_number  = p.mobile_number
                  AND     c.call_date_time >= p.start_date
                  AND     c.call_date_time <  p.start_date + 4
)
SELECT     *     -- or list columns wanted
FROM     got_cnt
WHERE     cnt     = 3
;

You can search for 2 or more distinct (mobile_number, start_date) target in the same query, if you wish.
It is easy to make consecutive (3) the number of days in this case a parameter.

Tags: Database

Similar Questions

  • I fell for the "eventvwr" scam and gave the appellant to control remotely from my computer.

    I fell for the "eventvwr" scam and gave the appellant to control remotely from my computer.  When I insisted on getting a phone on their part number, I shut down the computer, waited a bit and restarted again.  Everything seems normal, but I'm worried.  I had to give them a "id" so that they could take control remotely.  I have to worry about remote access to my computer now?

    I fell for the "eventvwr" scam and gave the appellant to control remotely from my computer.  When I insisted on getting a phone on their part number, I shut down the computer, waited a bit and restarted again.  Everything seems normal, but I'm worried.  I had to give them a "id" so that they could take control remotely.  I have to worry about remote access to my computer now?

    Remove all device has been installed to allow remote access.

    You need to change passwords on accounts and examine your computer and all data within being compromised.

    Your line of safer driving is to reformat/reinstall your operating system.

    You can also check the following links for more information:

    http://www.Microsoft.com/security/online-privacy/avoid-phone-scams.aspx

    http://www.mypchealth.co.UK/GuideScam.php

    http://ask-Leo.com/i_got_a_call_from_microsoft_and_allowed_them_access_to_my_computer_what_do_i_do_now.html

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-security/i-fell-for-the-eventvwr-phone-scam/8e79cd60-0a09-4ED6-85b0-056230878815?page=1

    Good luck...

  • I've implemented all the information for an email from the Charter and then when I click on get mail, it says there is a connection to the server error... Why?

    I've implemented all the information for an email from the Charter and then when I click on get mail, it says there is a connection to the server error... Why?

    Hello ChevyDriver10,

    Thanks for your post.  What email app do you use to receive your mail?

    In the meantime, take a look at the Charter of General electronic installation instructions.

    If you do not currently have an e-mail client, feel free to go on Windows Live Mail.

    See you soon

  • I bought Adobe Creative full package of cloud as a teacher, but applications that have tried to installed, they are the poster as the trial for 30 days, why it comes as version track and not as full version.

    I bought Adobe Creative full package of cloud as a teacher, but applications that have tried to installed, they are the poster as the trial for 30 days, why it comes as version track and not as full version, can someone help me on this, as I tried to reach the live chat, but can't find it

    Hello

    Adobe has established this link https://helpx.adobe.com/manage-account-membership/cc-reverts-to-trial.html

    After this, and if your applications make some problems you can use https://helpx.adobe.com/creative-suite/kb/trial--1-launch.html

    If necessary and for other issues, click on the http://helpx.adobe.com/contact.html until your arrival at the 'cat'. If it is 'open' (ago opening hours) Please use it, I personally had the best experiences. I quote Adobe Preran employee: the chat button is enabled as soon as there is an available agent to help.

    Hans-Günter

  • I have a subscription plan cc @ 49.99/month but my account also indicates a 30 day free trial account and it seems to be in conflict. Delete the account for 30 days?

    I have a subscription plan cc @ 49.99/month but my account also indicates a 30 day free trial account and it seems to be in conflict. Delete the account for 30 days?

    Hello

    Please do the following steps and then see the instructions in the links below:

    Connect and disconnect activate Cloud Creative applications

    Applications creative Cloud back in test mode after an update until 2015 for CC

    Activation and deactivation of troubleshooting

    Creating cloud connection errors

    Let us know if that helps.

    Kind regards

    Bani

  • How to install the update for bd-2012 from cyberlink on Eve comics on DVD HPMediaSmart.

    have dv7-1270US and reader of specific causes Blu - ray to request the upgrade for BD-2012. I downloaded the update on my desk (it's from cyberlink) and when it works, it finds MediaSmart DVD and it says that must be uninstalled everything first. When I select YES to uninstall MS DVD, I get the message, the Installshield wizard of MediaSmartDVD, "error. The definition of the lost product file. "can only click 'OK '. All other BD and regular movie discs play fine. I can't uninstall HPMediaSmart DVD. Any problem for some comic, I guess. When I'm looking at is a new version - "Knight and Day" with Tom Cruise and Cameron Diaz.

    Hi Stevengwp


    As the problem in HPMediaSmart DVD, I would suggest that you contact HP support for assistance in uninstalling the app or any other associates - suggestions

    http://h30434.www3.HP.com/PSG/

     

    I hope this helps.

  • LabVIEW System in the car for several days

    Hi all

    We strive to have a DAQ run in a trailer able to travel and expenses for three days several.

    In our previous tests, we used strain NI 9236 seven modules and a NI 9205, connected on a chassis CampactDAQ ethernet analog input module. This chassis is then plugged into a laptop that is running our software. It was all done inside, where we could use a standard wall outlet for the power supply.

    I was wondering if there was anyway we could make this system even run for 3 consecutive days, where half of the day, that data acquisition will be fueled by the power of the truck power, but during the nights, the system would have to run off a power supply 10VDC or similar.

    Does anyone have ideas on how to feed the system or external power supplies that would be able to last three days, while the system is running?

    Thank you!

    Hey cjwarren,

    This page NOR a lot of information on the power of your system cDAQ, it may be useful!

    http://www.NI.com/white-paper/52635/en/

  • Entry of the appellant for the call manager does not to the first entry, books on the second

    Unity 4.0 (4) SR1, 7.0 (4) flat TSP

    Have a call handler when option 4 as input, the appellant and the user calls into customer and they get the welcome message, but when they hit 4 it does not first time. Replays of greeting and they hit 4 again and it works fine. 4 is set to go Manager directory. 4 is a key blocked under the entry for the appellant. This happens whenever they call and get the salvation of the unit.

    They have 2 extensions 4xxx configured on the system also.

    The unit probably behaves correctly. To confirm that the unit made, turn on the microphone traces PhraseServertoMonitor and watch the appeal on PortStatusMonitor.

  • Photo, what are the criteria for images selected from the collections of photos?

    With Photo on my Mac when I'm in the view "of the years', I see all my photos. When I switch to 'Moments' I see all the photos, especially older. When I go to "collections", then I self pictures? What are the criteria for images selected in 'collections' of photos? Thank you

    You should see all the photos in the Moments, the years, Collections, unless you have the "Summarize" option enabled in Photos > Preferences > General.  Then some pictures will be omitted, but the rules are not documented.

  • Subtracting days from a Date

    Am using Acrobat 9 Pro for Windows.  I have a form where I want to subtract days from Date1 and Date2 results.  The Date1 and Date 2 text boxes are not formatted.  I tried reading the articles of 'date' and experimental with formulas but I'm afraid that I am still illiterate Acrobat.  Any ideas?  Thank you.

    It would be better if you set the Date1 field to be formatted as a date. In this way, Acrobat uses a built-in routine to validate automatically the entry represents a valid date. You can then use a calculation script custom of the field Date2 that looks like:

    // Custom Calculate script for text field
    (function () {
    
        // Get Date1 field value
        var v = getField("Date1").value;
    
        // If field is empty, blank this field
        if (v === "") {
            event.value = v;
            return;
        }
    
        // Convert the date string to a date object
        var d = util.scand("mm/dd/yyyy", v);
    
        // Subtract 5 days
        d.setDate(d.getDate() - 5);
    
        // Set this field's value
        event.value = util.printd("mm/dd/yyyy", d);
    
    })();
    

    Change the format of date (mm/dd/yyyy) in the code above to match what you want to use.

  • No video but able to hear the audio for downloaded movies from Frostwire

    Original title: no video

    I downloaded a movie from frostwire, in my frstwire library but when I try to read all the that get is sound and no video.  what I am doing wrong?

    Hello

    1. How do you try to play videos on the computer?

    2. which video player do you use to play the videos?

    3. the problem occurs only for a particular video or videos?

    4. What is the format of the video you are trying to play on the computer?

    The content probably uses a compression codec that is not installed on your computer. To ensure you have all the codecs installed on your computer that are currently supported.

    http://Windows.Microsoft.com/en-us/Windows-Vista/codecs-frequently-asked-questions

    Please provide more information to help you best.

    See also the link to support Frostwire.

    www.FrostWire.com/support

    Note: this response contains the reference to a third party software. Microsoft provides this information as a convenience to you. Microsoft does not control these sites and no has not tested any software or information found on these sites; Therefore, Microsoft cannot make any approach to quality, security or the ability of a software or information that are there. There are the dangers inherent in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

  • How to prepare the folio for prior approval from Apple, but not visible on Android?

    Quite possible I just forget something, but it doesn't make sense to me. We have already active application in the App Store and the Google game, with a lot of questions for sale. Now we must prepare a special issue, which will go on sale next week or something like that. So I want to prepare the purchase app for prior approval. Now, we do not have full Folio, just one with a dummy cover.

    Workflow according to the guidelines of the guide to publication is:

    -make public and retail folio

    -submit the purchase app from Apple

    - and wait.

    I did it.

    OK, but what about Android? I even created in-app purchase in google play, set the correct product ID and set as unique, but I still see this dummy folio on Android. I can't buy it, but I see it, and it's not good.

    So how to solve this problem?


    Thanks for the quick help!

    Martin, I've confirmed this with a tester. He said, 'on Android (Google Play), the customer will see all public folios because Google does not provide an API to check what is available for purchase on their servers. On Amazon AppStore applications, the folio must not be visible. »

  • How can I change the spellingchecker for outgoing messages from English to Dutch?

    My messagetext in Dutch appears with most of those underlined red words. Only the words which in this lettercombination available in English are not underlined. For example 'in' and 'wonder' exists in both languages and is not underlined. "Het" is the Dutch equivalent of 'The' and is underlined in red.
    I have no need of a spellingchecker in Dutch, so I don't want my text to look like letters in a box of Red snake. How can I fix that?

    In Thunderbird on Windows, go to Tools | Options | Composition | The spelling where you can disable the spell checking in all, or download other dictionaries if you change your mind.

    I don't know if there is an easy way to switch between several languages/dictionaries. I have not tried, not being myself not multilingual. But simply have no spellcheck at all could cause the least pain.

  • Bug in the search for qualified products from pilot

    I have only one registered product Toshiba, so when I open the search window, the product is preselected (marked as selected in a list of radio button with just one button, because I don't have only one product approved).

    If I then try to search for a driver, assuming that my product is screened in, I get an error claiming that I need to select a product before I am looking for.

    If I press the radio already pre-selected for my registered product button, the search runs. But rather than narrow the search down to drivers for my product, it finds ALL drivers!

    Can you please tell us which laptop model you have?

    You will find the drivers on Toshiba are supported on the page under http://eu.computers.toshiba-europe.com > support & downloads?

  • How can I do a restore of the system for five days in Vista

    My pc has become unstable and I tried to do a system restore, but cannot go further then five days > desperately need help.

    Hello

    Please read Section 4 check the box to restore more than Points 5 days:

    http://pcsupport.about.com/od/fixtheproblem/HT/system-restore-Vista.htm

    See you soon.

Maybe you are looking for

  • BRAVIA Internet video compatible TV

    Can someone tell me why I can't sussesfully register my essential account? I am providing the name of the device and the registration provided for me on television code (code letter/numbers 4).Is it because the TV is not registered with Sony? Help, p

  • Web service SOAP of the access of LabView?

    I like to connect to a service-based SOAP from my code Labview (PC), or at least to understand if it is possible and how it will be. Just googling "Labview SOAP" gives a few hits, so it seems that people do, but I've found any way white paper or exam

  • T60 taken under warranty?

    My take on my t60 is upward. The laptop will beep as if someone pulled the plug power on and off while I'm typing. It has never been dropped and has a 3 year warranty this would be covered? Thanks for any input.

  • Get the letters when I type the number of

    Original title: numeric keys why I get letters that appear on the screen when I press the number keys

  • Remove the constraint of PK to win space on INDEX tablespace

    I dropped a huge table (which has recently imported for testing) INDEX by deleting the PK constraint to win space on INDEX tablespace. But INDEX tablespace is not reduced image.Please notify.Kind regardsVeera