php - SQL Query If Statement? -


i have 2 fields in legacy database. want query 1 of them, null, in case there if statement like if field_a !== null { field_a='value' } else { field_b='value' }

my question is, there way in sql or have 2 queries, 1 check if null, if statement in logic?

i think can capture logic this:

where field_a = 'value' or (field_a null , field_b = 'value') 

or more as:

where field_a = 'value' or field_b = 'value' 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -