Re: SubSelect Workaround

2002-01-04 Thread Mr. psm996
> >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

SubSelect Workaround help

2002-01-02 Thread Mr. psm996
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

Equivalent Query in MySQL

2002-01-01 Thread Mr. psm996
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)