Help limiting inner join

Hello,

I need help limiting inner join.

my query:

SELECT uid
FROM users AS u
INNER JOIN files AS x ON u.fid = x.fid
WHERE u.left = '0'
AND x.flags = '0'
AND u.active = '1'
ORDER BY `u`.`uid` ASC

result:
uid
3
3
3
3
7
47
47
47
47
47
47
47
47
47
47

I need to limit INNER JOIN to 5 only. like:

uid 
3
3
3
3
7

47
47
47
47
47

If anyone could help me I will be very grateful

thank you

Something tells me this is only a very simplified version of the real query.
I mean, what use is a list of duplicated userid’s, whatever the number?

hint: LIMIT

it’s in da manual

:cool: