MySQL Forums
Forum List  »  Newbie

Re: SELECT COUNT(DISTINCT()) FROM mytable ¿LIMIT 5?
Posted by: davis palomino
Date: October 20, 2016 05:08PM

Table: mytable

id name
1 will
2 peter
3 peter
4 will
5 jhesus
6 jeshus
7 juan
8 robin
9 robin
10 francis

OK:

QUERY:
>SELECT COUNT(DISTINCT(name)) FROM mytable
answer:
> 6

ERROR:
QUERY:
SELECT COUNT(DISTINCT(name)) FROM mytable ¿LIMIT 5?
answer:
>6
>5
>4
>3
>2

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.