I’ve been looking at this far too long and my brain feels like spaghetti noodles. Could someone help me out with a couple of queries?
Tables:
Presentation
------------
id int
name varchar
fk_template int (references template.id)
Template
--------
id int
name varchar
Position
--------
id int
zorder int (if it is the 1st, 2nd, 3rd position of the given template)
fk_template int (references Template.id)
Asset
-----
id int
name varchar
description varchar
AssetForPresentation
--------------------
fk_asset int (references Asset.id)
fk_presentation int (references Presentation.id)
fk_position int (references Position.id)
What I think I need to be asking at this point is basically “give me all of the assets AND their positions for this template.”
You see, when a Presentation is brought it, it has a specific Template. Each Template has designated Positions, and each Position holds an Asset or NULL.
I need to be able to bring in all Assets and their individual positions for a particular Template used by a Presentation. How would I query for something like that?
I hope this makes sense to you.
I think the part you’re having hard time with is two conditions on
JOINto theAssetForPresentationtable.