Can anyone help with SQL?
Discussion
So our resident IT guru has left for xmas break and I'm struggling with something which is probably very simple!
It's a where statement. I'm putting (for example):
Select * from XYZ
where ABC = 12345678 or 23456789
and I'm getting a 'Non Boolean' error.
Can anyone suggest where to start looking? It seems straightforward in the table, a list of numbers! If I leave out the 'or 23456789' it will return one line, but as soon as I add the 'or' in, I get the error.
Thanks in advance!
It's a where statement. I'm putting (for example):
Select * from XYZ
where ABC = 12345678 or 23456789
and I'm getting a 'Non Boolean' error.
Can anyone suggest where to start looking? It seems straightforward in the table, a list of numbers! If I leave out the 'or 23456789' it will return one line, but as soon as I add the 'or' in, I get the error.
Thanks in advance!
audi321 said:
Select * from XYZ
where ABC = 12345678 or 23456789
You’re lucky it didn’t interpret the “23456789” as a non-zero value, and hence a Boolean “true”. The overall “where” clause would have been true regardless of the value of ABC, and the select would simply have returned all rows from the table. That would have been confusing for a beginner to diagnose.where ABC = 12345678 or 23456789
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


