Optimizing the repeated use of the same if condition inside a VIEW?
Test 

CREATE OR REPLACE VIEW VIEW_NAME AS (
SELECT 
    table0.fieldBlah "FieldBlah",
    --more fields
    IF(@tmp := (table1.foo or table2.foo IN ('State1', 'State2')), 0, table3.uniqueField) "uniqueFieldName",
    IF(@tmp, 0, table3.uniqueField2) "uniqueFieldName2",
    --more of these if statements with the same condition ,but different field
FROM table1 
--various joins with other tables
);