I want to ask Im sure a really simple question (at laest for most of you). Here is the situation:
I have 3 DB tables: products, tags and products_tags. products_tags has 2 columns product_id and tag_id (for many-to-many relationship). So the question is: how can I select products which have tag1 AND tag2 and tag3 and .... tagN? I need a best way in terms of performance. The only way I can think of now is to create a query with self joins. The query joins number would equal tags number - 1. Is there a better way? Maybe I miss here something fundamental (think). My project products need a way to be filtered by various tags... Thanks in advance. -- Aurimas L.
