Match same calls in different dates

Hi
I want to match calls made to a same number in differnt dates, I think it is with an inner join but I cant make it work. My table is a registry of calls made from several users.
Name     
Null Type   
TIME          
VARCHAR2(15)
CALLED_NUMBER 
VARCHAR2(20)
DURATION      
VARCHAR2(15)
COST          
FLOAT(126)  
EXTENSION     
VARCHAR2(15)
OPERATOR      
VARCHAR2(75)
DATE_T2       
DATE   
For example I want to match:  march-25-13, april-18-13 and may-15-13 and desired output would be:
called_number            Num_of_times
1234 56789                35        
1348 93328                24
234 8822                    13
348 9238 9834           8
Regards, Levi P.

896412 wrote:
Hi
I want to match calls made to a same number in differnt dates, I think it is with an inner join but I cant make it work. My table is a registry of calls made from several users.
Name    
Null Type  
TIME         
VARCHAR2(15)
CALLED_NUMBER
VARCHAR2(20)
DURATION     
VARCHAR2(15)
COST         
FLOAT(126) 
EXTENSION    
VARCHAR2(15)
OPERATOR     
VARCHAR2(75)
DATE_T2      
DATE  
For example I want to match:  march-25-13, april-18-13 and may-15-13 and desired output would be:
called_number            Num_of_times
1234 56789                35        
1348 93328                24
234 8822                    13
348 9238 9834           8
Regards, Levi P.
Why are TIME ( a very bad name for a column, anyway*) and DURATION defined as VARCHAR?  Time is simply a component of DATE.  And DURATION suggest it should be a number, of some assumed unit of measure.  As it is there is no functional difference between TIME='15:37:34' and TIME='here''s your sign ....'.   Same for duration.  It's not a matter of if your data will get corrupted, but a matter of when.   And then you'll be back here asking how work around the corruption.  You won't be asking how to fix the corruption, because the fix will involve taking time to correct that which your management said you didn't have time to do correctly in the first place.
*While TIME may not be a reserved word, it looks enough like it could be one to avoid it anyway.  I suggest making all column names at least two-part (seperated by an underscore).  That way you virtually eliminate the chance of using a reserved word.  It also pushes one to make for more descriptive column names.  TIME?  Time of what?

Similar Messages

  • Calling two different data sources within same transaction

    Hi,
    I have a method (in an Entity Bean), which I need to use two data sources.
    But the system give this error when I try to do it.
    An illegal attempt to use multiple resources that have only one-phase capability has occurred within a global transaction.
    Please help me to solve this problem.
    Best Regards,
    Chamal.

    I hope you need to use XA Drivers (while create the connection pool it self you need to choose the XA Drivers) for this. else you need to use the userTranscations instead of containers.
    Because other database drivers won't support this feature.
    Please try any of this. Using XA drivers is costly interms of performace.

  • Doing the same task for different data.. Do I need Queues? How to use them if yes?

    Hello all,
    I have created a VI which is getting data from some FTP server and then after comparing with the HDD specified folder copy the missing data from the FTP ... Description is also in the VI. There are few things I need to ask.
    1) The email sending VI gives error 1172..What could be the reason .. is it firewall.. or is there any mistake in the code?
    2) As you people are experts so I really like any suggestion to improve the VI..
    3) The most important .. Currently this VI can only perform the whole task for one FTP folder. Actually my task is I need to check for 4 different FTP folder on different servers..its not 4 different folder in one FTP .. its 4 different FTP.Now my question is how I can do this: First it compare and copy from FTP1.Then FTP2... and so on.. How can I change the data for the cluster for different FTPs? Do I need to use queues? If yes how because I don't have any experience with queues.
    I will really appreciate is someone can either provide me the relevant example or can give me some idea.
    The main VI is the 'TASK START'.VI please find the attached files.
    Thanks
    Regards,
    Naqqash
    Naqqash
    Attachments:
    Project.zip ‏151 KB

    Hi Peter,
    Thank you very much for your reply. I have understood your idea but there are few problems.
    Please see the attached "Final test.vi".. actually my top level vi should be like this.. due to this reason I need to develop the cluster like one with name "Settings" as shown in Enum FTP events.vi.. In this cluster all the data types are not constants (but can be set as constants)  and further all of them are not of same type so whenever I try to create as you created I have got error, wire broken..so what do you think i should do.. In this cluster there are different types of data .. string, path, numeric, array and a cluster with name file properties also... can't figure out what to do..I know things are little scattered and wiered but due to lack of experience, I guess, I am now a little bit confused for this matter. I
    hope guys here in the forum will help me as you guys always did.
    Naqqash
    Attachments:
    Final test.vi ‏11 KB
    Enum FTP Events.vi ‏14 KB

  • Reload the same viewController with different data?

    Hi -
    I have a view which can have either a list of, say, fruit, or fruit vendors. If it a list of vendors, clicking a vendor loads a view where it lists the fruit they sell. If it's a list of fruit, clicking a fruit loads a view where it lists all the vendors of that fruit.
    The same view controller controls that page no matter which set of data is displayed.
    What I'd like to do is animate the transition when that click takes place just like I was going to a different view controller.
    I tried this:
    [[self navigationController] pushViewController:self animated:YES];
    But it's not doing anything - at all.
    Is there a way to do this short of rewriting it to have two separate view controllers for the two sets of data?
    (Sorry, posted this in the wrong forum and I don't see a way to delete it here...)
    Message was edited by: Sue Boettcher1

    Well, I spoke too soon.
    I can get the page to load and it animates right, but I think I haven't got it hooked up right in the nib "referencing outlet" stuff correctly.
    I can't get my head around it - I have to create a new instance of the view INSIDE a method for the view itself. I can see where the other (original) instance of the view is hooked up in the nib but I can't figure out how to hook up the new second instance.
    I'm probably not explaining this very well but I can't post a screenshot...

  • Merge Two Tables with the same columns but different data

    I have a table that has the following columns:
    Current Table Definition
    commonname
    family
    genus
    species
    subspecies
    code
    I have a number of entries that don’t fit the current table definition – that is that they only have a common name or description and a code. These records don’t actually represent a species but are needed for data entry because they represent an object that may be encountered in the study (Bare Ground – which isn’t a species but would need to be recorded if encountered). So I would really like 2 tables:
    Table 1 Miscellaneous
    name
    code
    Table 2 Plant Species
    commonname
    family
    genus
    species
    subspecies
    code
    I would like two tables so I can enforce certain constraints on my species table like requiring that the family, genus, species, subspecies combination is unique. I can’t do this if I have all the “other” records that don’t have a family, genus, species, or subspecies unless I put in a lot of dummy data into the fields to make each record unique. I don’t really want to do this because these miscellaneous records really don’t represent a specific species.
    So – the problem is that while I want this data separate I will need to point a column from another table to the code column in both tables.
    How is this best done? Table? View? Merge?

    Hi,
    Actually you don't have to use scope refs. Sorry but I misunderstood you earlier. Here is a complete example that does exactly what you want. Notice how I added the constraint to the materialized view. Also notice when we try to insert a code in tbl3 that doesn't exist in the view, we get an error. HTH.
    SQL> create table tbl1 (name varchar2(10), code varchar2(3) primary key);
    Table created.
    SQL> create table tbl2 (commonname varchar2(10), code varchar2(3) primary key);
    Table created.
    SQL> insert into tbl1 values ('n1','c1');
    1 row created.
    SQL> insert into tbl1 values ('n2','c2');
    1 row created.
    SQL> insert into tbl1 values ('n3','c3');
    1 row created.
    SQL> insert into tbl2 values ('name1','c1');
    1 row created.
    SQL> insert into tbl2 values ('name2','c2');
    1 row created.
    SQL> insert into tbl2 values ('name3','c3');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> create materialized view view1 as select name, commonname, tbl1.code from tbl1, tbl2 where tbl1.code = tbl2.code;
    Materialized view created.
    SQL> select * from view1;
    NAME COMMONNAME COD
    n1 name1 c1
    n2 name2 c2
    n3 name3 c3
    SQL> create table tbl3 (code varchar2(3), record varchar2(1));
    Table created.
    SQL> alter table view1 add constraint view1pk primary key (code); -- <-Note how I added a constraint to the view
    Table altered.
    SQL> alter table tbl3 add constraint tbl3fk foreign key (code) references view1(code);
    Table altered.
    SQL> insert into tbl3 values ('c1','r');
    1 row created.
    SQL> insert into tbl3 values ('c99','r');
    insert into tbl3 values ('c99','r')
    ERROR at line 1:
    ORA-02291: integrity constraint (RAJS.TBL3FK) violated - parent key not found
    SQL> spool of;
    -Raj Suchak
    [email protected]

  • Same lens gives different data

    In LR3 I see the same Nikon Lens twice once as 18,0-70,0mm and 18.0-70.0. Only the last one is automatically recognised.
    How did this happen and what to do about it?
    Nikon AF-S DX Zoom -Nikkor 18.0-70.0 f/3.5-4.5 

    OK, I found it myself.
    the lens with the comma is a JPG and lens profile cannot be applied.
    Even in Custom, Nikon this lens is not present, though other lenses are.
    Is this normal behaviour ?

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • Problem with SQL*Loader and different date formats in the same file

    DB: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    System: AIX 5.3.0.0
    Hello,
    I'm using SQL*Loader to import semi-colon separated values into a table. The files are delivered to us by a data provider who concatenates data from different sources and this results in us having different date formats within the same file. For example:
    ...;2010-12-31;22/11/1932;...
    I load this data using the following lines in the control file:
    EXECUTIONDATE1     TIMESTAMP     NULLIF EXECUTIONDATE1=BLANKS     "TO_DATE(:EXECUTIONDATE1, 'YYYY-MM-DD')",
    DELDOB          TIMESTAMP     NULLIF DELDOB=BLANKS          "TO_DATE(:DELDOB, 'DD/MM/YYYY')",
    The relevant NLS parameters:
    NLS_LANGUAGE=FRENCH
    NLS_DATE_FORMAT=DD/MM/RR
    NLS_DATE_LANGUAGE=FRENCH
    If I load this file as is the values loaded into the table are 31 dec 2010 and 22 nov *2032*, aven though the years are on 4 digits. If I change the NLS_DATE_FORMAT to DD/MM/YYYY then the second date value will be loaded correctly, but the first value will be loaded as 31 dec *2020* !!
    How can I get both date values to load correctly?
    Thanks!
    Sylvain

    This is very strange, after running a few tests I realized that if the year is 19XX then it will get loaded as 2019, and if it is 20XX then it will be 2020. I'm guessing it may have something to do with certain env variables that aren't set up properly because I'm fairly sure my SQL*Loader control file is correct... I'll run more tests :-(

  • I have multiple devices backed up to the same computer each with different data. how do i keep them from syncing all data when i back up or transfer stuff from the computer to a device?

    i have multiple devices backed up to the same computer each with different data. how do i keep them from syncing all data when i back up or transfer stuff from the computer to a device? one is an iphone 6 and the others are ipad mini first gens, each ipad has 64gb and the iphone has 128, need to keep the data seperate as they are not all mine

    Itunes content and pics are NOT part of the backup that itunes performs.
    Backing up, updating, and restoring iPad, iPod touch, and iPhone software
    You should transfer any purchases from iphone regularly:  File>Transfer Purchases  , if they fail to be transferred when you sync.
    You buy one and only one download.  It is your responsibility to move/copy/backup your purchases.
    You can try contacting itunes support and asking for an exception, but they are under no obligation to allow.
    http://www.apple.com/support/itunes

  • Iam using iphone 4s and Iphone 5s with same apple ID but my network is different and whenever Iam getting call in i5s and in my both handset same calls are coming. Please provide me solutions

    Iam using iphone 4s and Iphone 5s with same apple ID but my network is different and whenever Iam getting call in i5s and in my both handset same calls are coming. Please provide me solutions

    On both devices, go to Settings>Facetime and turn off cellular calls.
    ~Lyssa

  • How to find a selection of photos taken at different dates but imported together. I want them in the same album but they're no longer in the "last import" album.

    I imported a bunch of photos taken at different dates that i wanted to group together in the same album but they are not in the "last import" album and are all just mixed in with "all photos" according to the dates they were taken and it's impossible to sift through them all to select the ones i wanted.

    Sorry I'm terrible at explaining and even using my macbook haha. Let me try again. I imported some photos that I wanted to group together into an album. I forgot to create the album before importing a new set of photos which then took the place of the previous ones in the "last import" album. Is there anywhere or any way I can easily find the selection of photos I forgot to put into an album together without having to select them one by one from the "all photos" section? These would be the only pictures in my Photos application that haven't been organized into an album yet if that helps; however, these photos were not taken on the same date.

  • Same Input name with different data type cause the reflection exception

    I have a proxy contains couple RFCs. Two RFCs contain an argument named IN_COMPANY_CODE with data type of ZTRE_FX_BUKRSTable. Another RFC contains the same argument name of IN_COMPANY_CODE but hold different data type (String). All RFCs are in the same proxy. Complie and build the application with no issue.
    But when I ran the RFC, it generates the reflection exception below:
    Method SAPProxy1.Z_F_Tre_R_Pre_Trade_Fx can not be reflected. --> There was an error reflecting 'In_Company_Code'. > The XML element named 'IN_5fCOMPANY_--5fCODE' from namespace '' references distinct types System.String and MSTRFOREX.ZTRE_FX_BUKRSTable. Use XML attributes to specify another XML name or namespace for the element or types.
    I realize the conflict introduced by the same name with difference data type. But I would like to know if this is fixable as a bug or if there is any best practice and/or some manual intervention to make it work.

    Please install fix from OSS note 506603. After this, right-click .sapwsdl file and select "Run custom tool".

  • Different Date Formats in the same "From"

    Hello
    We used different date formats depending on the users language.
    In a report this is simple to implement ... read the date field twice (in different formats dd/mm/yyyy and mm/dd/yyyy) and display only one based on the language.
    I want to be able to do the same in a "form" which updates a date. In this case the about is not allowed.
    Has anyone have solution for this using "APEX" forms or do a need to write a process to achieve this?
    Thanks
    Pete

    Pete,
    You don't specify what version of Application Express you're using, so I'll assume APEX 3.1 or later.
    Are you setting the date format yourself, based upon the user's language?
    1) You could have the application's language derived from Browser, and then APEX would automatically set the NLS_LANGUAGE and NLS_TERRITORY settings accordingly. Then, I would simply use 'DS' as the Application Date Format. For Date Pickers on a form, I would use item type 'Date Picker (use Application Date Format)'.
    2) If you're already determining the date format yourself and you don't want APEX to do it for you, ensure that you are setting this value in an application item (e.g., PETE_DATE_FORMAT). Then, you could still use Application Date Format with a value of &PETE_DATE_FORMAT. (inclusive of the trailing period).
    When you use Application Date Format, the conversion should happen automatically for you so that you don't have to code this yourself on the Form.
    I hope this helps.
    Joel

  • URGENT: XML-SQL: Error parsing different date formats in the same XML file.

    Hi Everyone,
    I have a big problem while using the XML-SQL utility. I have a XML file with different date formats. I get exception like the one below.
    "oracle.xml.sql.OracleXMLSQLException: 'java.text.ParseException: Unparseable date:"
    And the XML file is :
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Info Key="ID">
         <Insert>
              <ID>1</ID>
              <BookingDate>10.12.2001</BookingDate>
              <OpeningTime>19:16</OpeningTime>
         </Insert>
    </Info>
    I have tried using different setDateFormat which is contrary.
    sav.setDateFormat("d.M.y");
    sav.setDateFormat("H:m:s");
    Can someone help me on the same.
    Thanks in advance.
    Subramanian.

    You might have to describe the columns as varchar then modify the table to the right format.

  • Using Labview how can one store different data in different sheets of same excel file, I mean how to select different sheets to store data??

    Hello Everyone,
    I want to store various data but in different sheets of excel file. So how to select Different sheets of same excel file???
    Thanks so much 
    Pallavi 

    aeastet wrote:
    Why do you not want to use Active X?
    One very good reason that I can think of is that MS keeps changing their ActiveX interface with each version of Excel, so code written for one version of Excel using ActiveX may not work for another version of Excel, even though the basic functionality hasn't changed. A perfect example is when MS changed the "Value" property to "Value2". Yeah, that made a whole lot of sense.
    pals wrote:
    I dont want to use active X as i am not
    getting results... by using write to spreadsheet in am getting results
    but on just one sheet... I want different data on different sheets of
    same excel file. So....
    Can anyone help me in this...
    Then it's something you're doing. Please post your code. Have you tried a search on this forum for ActiveX and Excel? There have been tons of posts on it, including lots of examples. There's also the Excel thread.

Maybe you are looking for