Help for this page

Select Code to Download


  1. or download this
    # sql to calculate date differences in same column
    # SELECT B.*
    ...
    # ON A.ordernum = B.ordernum
    # AND A.agent = B.agent
    # AND (A.mindatetime = B.[datetime] OR DATEADD(minute, 120, A.mindatet
    +ime) <= B.[datetime])
    
  2. or download this
    #!/usr/bin/perl 
    #query to get the difference between dates and things in the same colu
    +mns... 
    ...
    }
    $sth_query->finish;
    $dbh->disconnect;
    
  3. or download this
    CREATE TABLE  `new`.`test2` (
      `id` int(11) NOT NULL auto_increment,
    ...
     (7,'B','2008-01-03',200),
     (8,'A','2008-01-01',110),
     (9,'A','2007-01-01',100);
    
  4. or download this
    A,      1       2007-01-01      2007-01-01      0,      100,    100,  
    +  0
    A,      2       2008-01-01      2007-01-01      365,    110,    100,  
    +  -10
    ...
    C,      1       2008-02-03      2008-02-03      0,      10,     10,   
    +  0
    C,      2       2008-02-05      2008-02-03      2,      20,     10,   
    +  -10
    C,      3       2008-02-06      2008-02-05      1,      15,     20,   
    +  5