[eluser]Unknown[/eluser]
Hello I am having a little problem getting my head around the active record class. I have need make a simple SQL query. I have three tables tariff, state, and market. state and market have foreign keys inside the tariff table. Here is the SQL Query that works corectly on the data.
Code:
SELECT TARIFF.tariff_id, TARIFF.schedule, STATE.state, MARKET.name
FROM TARIFF,STATE, MARKET
WHERE TARIFF.state_id = STATE.state_id && MARKET.market_id = TARIFF.market_id
I get into trouble when I try to add the second and third tables into the mix. Can anyone help me out with the right way to do this. If I could see the example I think I could expand on it for the rest of my application.
Thank you in advance