How to return results with integers and nulls?

1

I'm trying to set up a Query but they are not having success, in my database I have 28 information with code 32, and 62 information with code 23, but there is information with the null code, and I wanted to bring them all together , the problem is that when I try to fetch the result by throwing the codes in the WHERE tag the query comes empty.

Example:

SELECT * FROM tabela WHERE campo IN (23, 32, NULL);

I tried it too:

SELECT * FROM tabela WHERE campo IN (23, 32) AND campo IS NULL;

Would anyone have a solution?

    
asked by anonymous 16.08.2016 / 13:30

1 answer

1

You were almost a colleague, try this:

SELECT * FROM tabela WHERE campo IN (23, 32) OR campo IS NULL;
    
16.08.2016 / 13:34