I am having a hard time understanding why the following query is not working?
select id,sold_dealer_id from myi_corporate where sold_dealer_id != 36;
When I do the following I am getting the result
select id,sold_dealer_id from myi_corporate where sold_dealer_id = 36;
However for != I am not getting the opposite results.
I am returning to psql after a long time after using MongoDB and might have forgotten the basics. Any suggestion is much appreciated
where sold_dealer_id != 36or sol_dealer_id is null- or simplified towhere sold_dealer_id is distinct from 36` – Nov 11 '19 at 16:22IS NULLsolves the problem, but I am trying to get values that are not!= 36, any suggestion is much appreciated, but i now know the cause isNULLThanks :) – Sijan Shrestha Nov 11 '19 at 16:32select * from myi_corporate where sold_dealer_id is distinct from 36got the query worrking :) – Sijan Shrestha Nov 11 '19 at 16:41true,false, andnull. Useis nulloris distinct fromwhen comparing againstnull. – Colin 't Hart Nov 11 '19 at 18:25OR IS NOT NULL? – Vérace Nov 12 '19 at 16:41