3 |
use DBI; |
use DBI; |
4 |
|
|
5 |
my $connect = "DBI:Pg:dbname=corp"; |
my $connect = "DBI:Pg:dbname=corp"; |
6 |
my $sql="select lse.date,lse.current as lse,ftse.current as ftse |
my $sql="select date(s1.date),avg(s1.current) as zse,avg(s2.current) as ftse |
7 |
from stocks as lse,stocks as ftse where lse.date=ftse.date |
from stocks as s1,stocks as s2 where time(s1.date) != '23:23:23' and |
8 |
and lse.type='LSE' and ftse.type='FTSE' |
time(s2.date) != '23:23:23' and s1.date=s2.date and |
9 |
order by date"; |
s1.type='LSE' and s2.type='FTSE' |
10 |
|
group by date(s1.date),date(s2.date) |
11 |
|
"; |
12 |
|
|
13 |
my $dbh = DBI->connect("$connect","","") || die $DBI::errstr; |
my $dbh = DBI->connect("$connect","","") || die $DBI::errstr; |
14 |
|
|