SELECT column1, column2, column3 FROM table1 WHERE (column5 = 0 AND column6 = 0) OR (column5 != 0 AND column6 != 0)