How to select two records from each table?

just say example;

I have two tables, one is category and another one is product. product table has categoryid joined to category table on categoryid. I would like select only two records from each table.

example; if there were 5 category, then the result will be 10. if there were 12 category, then the result will be 24. but should be limit it 20 records only, two records from each table.

thanks!