select t.colum1,t.colum2(casewhent.colum1 = ''then''t.when colum2 = ''then''else''end) as colum3from table t