I have read that after select we use column-names but I have found a statement that was like this:
SELECT 'A' FROM T WHERE A = NULL;
would you lease help me? thanks (A is a column- name here?)
my DBMS is MySQL
EDITED : the exact question is this that:
Will the above statement produce a row (select all that
apply)? Notice that ANSI_NULLS is OFF.
I want to know that the above statement will work? because some of you said that we should write IS NULL instead of =null
解决方案
Based on that query, you would get a result set containing the character 'A' for each row where the column named A was equal to null.
If you actually want to see the value of the column A instead of the character 'A', you have to remove the single quotes:
SELECT A FROM T WHERE A IS NULL
Either way, you should not use = NULL. Certain RDMSs don't handle that the way you would think. The standard is to use IS NULL instead.