I really need some help with some SQL.
Question 1:
It's easy enough to get all "assets" that belong to a "presentation" if the asset has a corresponding "presentationid" within it's table.
SELECT * FROM asset WHERE presentationid = 3
But how to I accomplish the same thing by joining? What's the best way to say:
SELECT * FROM asset WHERE ...
asset is connected to presentation via "presentationasset":
TABLE asset
id
name
TABLE presentation
id
name
TABLE presenationasset
id
presentationid
assetid
I hope this makes sense. I want to list out all of the actual assets and their columns, not the association table. :)
Question 2: (not as important)
I have my application setup so that "presentation" is a class and "asset" is a class...
With question 1 in mind, how do I return each of the associated assets as "asset" objects? Or does that even matter?