A quick guess, or at least a starting point:

SELECT key, data
FROM myTable
GROUP BY key
LIMIT 2

HTH,
Arthur

On Sat, Dec 3, 2011 at 11:41 AM, Blog Tieng Viet <blogtiengv...@yahoo.com>wrote:

> Hellow everybody.
>
> I have a problem difficult for me, please give me an advice.
>
> I want to get a specific number of entry (rows) from a table
> by each Key. If the number is 1, I can use "select dinstinct",
> but the number is not 1, I don't know how to select.
>
> For example:
>
> Key 0 | data 0-0
> Key 0 | data 0-1
> Key 0 | data 0-2
> Key 1 | data 1-0
> Key 1 | data 1-1
>
> I want to select 2 data for each key.
> Key 0 (data 0-0, data 0-1), Key 1 (data 1-0, data 1-1).
>
> How to describe in query ?
>
> Best regards.
>

Reply via email to