select xxx,xxx from xxx where decode(AAA,0,BBB,1,CCC)='12345'
如果AAA字段等于0则AAA=''12345'
否则如果BBB字段等于1则BBB='12345'
否则CCC='12345'