Welcome Guest, Not a member yet? Register   Sign In
Active Record Class Join question
#1

[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


Messages In This Thread
Active Record Class Join question - by El Forum - 01-26-2008, 02:01 AM
Active Record Class Join question - by El Forum - 01-26-2008, 02:26 AM
Active Record Class Join question - by El Forum - 01-26-2008, 02:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB