Odd query results

Bob Sneidar bobsneidar at iotecdigital.com
Wed Dec 14 19:31:04 EST 2016

Hi all. 

I had an odd result from a query. First, I created a customer and site whose unique id's were 0 for a primary key autoincrementing column. I did this so that I can decommission devices by assigning 0 for their customer and site id's, and then find them later by selecting the customer ID 0. With me so far? 

Well when I queried for empty or null site id's I got the records whose siteid's are 0! 0 is not empty OR null. Is this what SQL is supposed to do? In other words, is 0 the same as NULL the same as Empty String? It's so obscure because the unique autoincrementing integers usually start with 1, NEVER 0. 

The BugMeister
(Bob S)

More information about the Use-livecode mailing list