# explain these choose claims!

I am unable to obtain the difference betwwn these claims? can you help me,I've read some sample of choose claims but I didn't get these ones.

``````SELECT 'B' FROM T WHERE A = (SELECT NULL);
SELECT 'C' FROM T WHERE A = ANY (SELECT NULL);
SELECT 'D' FROM T WHERE A = A;
``````

I personally use MySQL

EDITED: also it features a conditional part that : SET ANSI_NULLS is OFF

ANSI_NULL ON

``````SELECT 'B' FROM T WHERE A = (SELECT NULL);
``````

is equivalent to:

``````SELECT 'B' FROM T WHERE A = NULL;
``````

Which always returns a clear set because anything in comparison to NULL returns NULL, not the case. You could try this:

``````SELECT 'B' FROM T WHERE A IS NULL;
``````

The 2nd totally essentially exactly the same and can return a clear set:

``````SELECT 'C' FROM T WHERE A = ANY (SELECT NULL);
``````

If Your includes a value, the next will return all rows:

``````SELECT 'D' FROM T WHERE A = A;
``````

Except, if your IS NULL, it'll return a clear set.

ANSI_NULL OFF

``````SELECT 'B' FROM T WHERE A = (SELECT NULL);
``````

is equivalent to:

``````SELECT 'B' FROM T WHERE A = NULL;
``````

Which returns all rows in which a IS NULL.

The 2nd totally essentially exactly the same and can return rows in which a IS NULL:

``````SELECT 'C' FROM T WHERE A = ANY (SELECT NULL);
``````

The next will invariably return all rows, whether or not A IS NULL:

``````SELECT 'D' FROM T WHERE A = A;
``````