I have a table to entities (lets call them people) and properties (one person can have an arbitrary number of properties). Ex:
Name Age
---
You can use INNER JOIN to link the two tables together. More info on JOINs.
SELECT *
FROM People P
INNER JOIN Properties Pr
ON Pr.Name = P.Name
WHERE P.Name = 'Joe' -- or a specific age, etc
However, it's often a lot faster to add a unique primary key to tables like these, and to create an index to increase speed.
Say the table People has a field id
And the table Properties has a field peopleId to link them together
Then the query would then look something like this:
SELECT *
FROM People P
INNER JOIN Properties Pr
ON Pr.id = P.peopleId
WHERE P.Name = 'Joe'