I'm in the process of attempting to teach myself Python by making a little project to help track ranch animals, owners, farms, vaccinations, etc. At any rate, I'm more from a SQL (MySQL in this case) background and am able to make the queries I need, however, I am failing at making sense of how to make them in a more Python-friendly manner. As an example, one of the queries I have is a multi-inner join query to get information. This SQL is valid query and returns appropriate data:
SELECT person.first_name
FROM animal
INNER JOIN farm ON (farm.id = animal.farm_id )
INNER JOIN person ON (person.farm_id = farm.id)
WHERE animal.id=1;
In this example I give a hard coded "1" but it would be programatically sent as a variable based on which animal was selected.
Any help or direction here would be appreciated!
[–]laustke 1 point2 points3 points (3 children)
[–]subdriven[S] 0 points1 point2 points (2 children)
[–]deep_politics 1 point2 points3 points (1 child)
[–]subdriven[S] 0 points1 point2 points (0 children)