in reply to Re^6: wild cards in Vertica
in thread wild cards in Vertica

If I'm reading you correctly:

AND CLName LIKE('A%','MET-CL1',BDO-CL1')

Should become:

AND ( CLName LIKE 'A%' OR CLName LIKE '%MET-CL1%' OR CLName LIKE '%BDO-CL1%' )

Replies are listed 'Best First'.
Re^8: wild cards in Vertica
by erix (Prior) on Jul 02, 2015 at 14:12 UTC

    AND ( CLName LIKE 'A%' OR CLName LIKE '%MET-CL1%' OR CLName LIKE '%BDO-CL1%' )

    As the OP is working a postgres derivative: in postgres (like perl, a bit TIMTOWTDI) that could be written:

    AND CLName LIKE ANY (array['A%','%MET-CL1%','%BDO-CL1%'])
Re^8: wild cards in Vertica
by pragov (Novice) on Jul 06, 2015 at 15:29 UTC
    Yes That is the exact way I need the SQL WHERE as It's not always A.It could be any prefix and followed by complete CLNAME. AND CLName LIKE('A%','MET-CL1',BDO-CL1'). But If there is no prefix, then it should work for AND CLName LIKE('ATN-CL1','MET-CL1',BDO-CL1') as well. Thanks