I’m starting to learn/use SQL and I’m wondering if I can make the usage easier. I have tables with ID which reference each other. So I often issue queries like
SELECT ...
FROM Object o
JOIN Property p on o.uid=p.object_uid AND ...
There are other tables with similar ID references. Is there a comfortable way to avoid writing out these ID clauses over and over again? I mean that particular Object table will always reference the Property table this way.
As far as I know, with using the alias functionality you are doing the best you can shortening the query.
Alternatively there is a shorter syntax but only there a similar field in both tables
http://dev.mysql.com/doc/refman/5.0/en/join.html
all the best