<p>Given a SCHEMA for implementing tags</p>

<p>ITEM
ItemId, ItemContent</p>

<p>TAG
TagId, TagName</p>

<p>ITEM_TAG
ItemId, TagId</p>

<p>What is the best way to limit the number of ITEMS to return when selecting with tags?</p>

<pre><code>SELECT i.ItemContent, t.TagName FROM item i 
INNER JOIN ItemTag it ON i.id = it.ItemId 
INNER JOIN tag t ON t.id = it.TagId 
</code></pre>

<p>is of course the easiest way to get them all back, but using a limit clause breaks down, because you get an duplicate of all the items for each tag, which counts toward the number of rows in LIMIT.</p>

Maybe something like
```
```
select i.ItemContent, t.TagName from (SELECT ItemId, ItemContent FROM item limit 10) i
INNER JOIN ItemTag it ON i.ItemId = it.ItemId --You will miss tagless items here!
INNER JOIN tag t ON t.id = it.TagId
```
```