Johan Pettersson wrote:
Hi Philippe,
how about this:
SELECTstrategyid, COUNT(marketid) cnt
FROMstrategies_markets
WHERE marketid in()
GROUP BY strategyid
ORDER BY cnt DESC;
The resultset should contain the best matches, in descending order. To
find strategies that contains all markets
Hi Philippe,
how about this:
SELECT strategyid, COUNT(marketid) cnt
FROMstrategies_markets
WHERE marketid in()
GROUP BY strategyid
ORDER BY cnt DESC;
The resultset should contain the best matches, in descending order. To
find strategies that contains all markets (but that may contain others
Hi,
Here are the tables :
CREATE TABLE markets (
Id integer NOT NULL auto_increment,
ContractCode varchar(20),
PRIMARY KEY (Id),
) TYPE=InnoDB;
CREATE TABLE strategies (
Id integer NOT NULL auto_increment,
StrategyCode char(15) NOT NULL DEFAULT '',
PR