Hey. I can't really figure out how to get this query to work. Any help would be greatly appreciated!
Where tId1 & tId2 correspond to ids in asx200.
I want to write a select statement which returns the covar and the tickerSymbols which correspond to both tId1 and tId2. So for example:
covar: 1, 2, .001
The SELECT statement would return:
Any help would be greatly appreciated. I've been looking around at different JOIN statements, but can't get it to work with this example.
Thanks a lot.
Thanks for that! Works perfectly.
You are on the right track, JOIN is the way to go. You'll have to join the asx200 table two times to the covar table (using aliasses to identify them):
a1.tickerSymbol AS tickerSymbol1
, a2.tickerSymbol AS tickerSymbol2
INNER JOIN asx200 AS a1
ON a1.id = covar.tId1
INNER JOIN asx200 AS a2
ON a2.id = covar.tId2