SQL statement in the table

  • Thread starter Thread starter inungh
  • Start date Start date
I

inungh

I have my option in the table just for easier configuration, but I get
too complex SQL message for a number field with 1 or 0 criteria.

MyStatus field in MyTable which is a number field.

My SQL is

Select * from MyTable where MyStatus = (select MyOption where
MyOptionID = 1)

It works if MyOption is "1", but I got too complex SQL statement when
MyOption is "1 or 0"

Are there any work around to store more than one option in the table
for multi criteria?


Your help is great appreciated,
 
Your terminology is confusing to me.
You can not have SQL in a table.
MyStatus is a field in your table named MyTable. What kind of object is
MyOption?

What are you trying to do with this query --
Select * from MyTable where MyStatus = (select MyOption where MyOptionID = 1)
 
I think you have to write it like

WHERE (MyOption=1) OR (MyOption=0)

The parentheses aren't strictly necessary but they make it easier to read
and debug.

I don't think you can do what you're attempting (multiple conditions with
the field referenced just once)

MyOption = 1, or 2 or 178.0, etc.
 
I think you have to write it like

WHERE (MyOption=1) OR (MyOption=0)

The parentheses aren't strictly necessary but they make it easier to read
and debug.

I don't think you can do what you're attempting (multiple conditions with
the field referenced just once)

MyOption = 1, or 2 or 178.0, etc.











- Show quoted text -

Thanks millions for helping,
 
Back
Top