Now I answered the question about SQL, I saw the neighboring answer and wondered if these 2 queries will always be identical in result:
SELECT table1.* FROM table1 INNER JOIN table2 ON table1.id = table2.table2_id WHERE table2.name = 'something.zip' and
SELECT t1.* FROM table1 t1 INNER JOIN (SELECT table2_id FROM table2 WHERE name = 'something.zip') t2 ON t1.id = t2.table2_id Could there be cases when these 2 queries on one table will give a different answer? For example, the 1st query will return fewer lines? Or is it completely 2 identical queries and for any data in the tables table1 and table2 will produce the same result?
table1.*Instead of a common*sample, it will be. But in terms of execution time they will not be identical. - Alex Krass