>
>database,sql,query,table
>Can someone please tell me why this won't work.
>
>if (defined($res)){
> my $stmt = qq{select distinct symbol from portfolio where $res};
> my $sth = $dbh->prepare($stmt);
> $sth->execute();
>
> my $portsymbols = "";
>
> while ($sth->fetchrow) {
> $portsymb
How would one load the results of the following query into a one line comma
separated list so that it could be then included with an IN expr to get
around the lack of subselect in MySQL
select distinct symbol from portfolio where type='401k' AND owner='jim'
select distinct p.symbol, i.name f
Would anyone know how the query below could be written to support MySQL?
my $stmt = qq{select distinct p.symbol, i.name
from portfolio p, stockinfo i
where p.symbol = i.symbol };
$stmt .= qq{and p.symbol in
(select distinct symbol from portfolio where $res)