sql - MySQL WHERE with conditions/priority condtion -


this 1 weird 1 can't seem wrap head around.

basically need search based on value has override. there 2 columns same content. 1 updated automatically , 1 manual. if automatic 1 not available use manual, , if manual not available use automatic one. lastly if both available use automatic unless , "override" flag enabled (probably third column).

what need search based on parameter if 1 field, using set of priorities on columns. here example statement, not know might correct syntax use.

where (isset(width)?(width_override?o_width:width):o_width) = {query} 

use if function.

where if(width not null, if(width_override, o_width, width),                             o_width) = {query} 

Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -