# How does NULL behaves with distinct keyword? [closed]

Suppose I have a relation R

How many tuples are returned by SQL query

SELECT distinct manager FROM R

Is it $2$ or $4$ ?

## closed as off-topic by David Richerby, Gilles♦Dec 31 '16 at 19:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

• What have you tried? Where did you get stuck? We do not want to just hand you the solution; we want you to gain understanding. However, as it is we do not know what your underlying problem is, so we can not begin to help. See here for tips on asking questions about exercise problems. If you are uncertain how to improve your question, why not ask around in Computer Science Chat? – Raphael Dec 31 '16 at 8:21
• How about trying it out? – Yuval Filmus Dec 31 '16 at 8:51
• I tried running it. But it shows different behaviour. – mcjoshi Jan 1 '17 at 0:33

You will get 2 records, with value 2 and null

NULL is still a value when it comes to distinct, but it is not included if you do a count, so

select count(manager) from r;


would just return a count of 1