1

Re: SQL Problem - Rows Missing

The query below is being run on a flat file version of Recorder to be modified later for general use.

Select * From Records
Where NOT (Abundance = '0 Count of absence of sign' OR Abundance = '1 Count of absence of sign' OR Abundance = '0 Count of alive'
     OR Abundance = '0 Count of droppings' OR Abundance = '0 Count of droppings; 0 Count of anal jelly' OR Abundance = '0 Count of Tracks'
      OR Abundance = '1 Count of absence of sign')

It removes some old style negative records still hanging on from R3.

The problem is this; when run the number of rows reported goes down by nearly 200,000. If I run this;

Select * From Records
Where  (Abundance = '0 Count of absence of sign' OR Abundance = '1 Count of absence of sign' OR Abundance = '0 Count of alive'
     OR Abundance = '0 Count of droppings' OR Abundance = '0 Count of droppings; 0 Count of anal jelly' OR Abundance = '0 Count of Tracks'
      OR Abundance = '1 Count of absence of sign')

The result is about 13,000. So I'm wondering what mistake have I made?

Can anyone spot it?

Data Manger
Somerset Environmental Records Centre

2

Re: SQL Problem - Rows Missing

The queries look ok to me. I would expect them to return complimentary results adding in total to the records in the file (Ignoring nulls which neither query will include).

Mike Weideli

3

Re: SQL Problem - Rows Missing

Thanks Mike I needed another set of eyes as I could only see the same. I will have to look elsewhere though that will be interesting as it seems too simple to account for any difference.

Data Manger
Somerset Environmental Records Centre

4

Re: SQL Problem - Rows Missing

I now realise they are Abundance = NULL. The joy of Microsoft where nothing is something except when you ask a question.

Data Manger
Somerset Environmental Records Centre