The question title is probably confusing so I’ll try to clear it up.
I have two columns in a grid. State and Locality.
I have two foreign keys in a table. Notification.fkState and Notification.fkLocality.
They are both linked to the primary key of another table. Location.pkLocation
I want the ALIASES of State and Locality to equal the Location.Name from the Location Table according to the foreign key value linked the primary key pkLocation.
Is there a statement like
SELECT Location.Name(WHERE Notification.fkState=Location.pkLocation) AS State, Location.Name(WHERE Notification.fkLocality=Location.pkLocation) AS Locality FROM Notification INNER JOIN Locality ON Notification.fkState=Location.pkLocation AND Notification.fkLocality=Location.pkLocation
My AND is currently an OR because when it is AND…it displays nothing.
Any help?
1 Answer