Given a SCHEMA for implementing tags
ITEM ItemId, ItemContent
TAG TagId, TagName
ITEM_TAG ItemId, TagId
What is the best way to limit the number of ITEMS to return when selecting with tags?
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
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.