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

What value do you want to be in $Where?

As to how to tell what is prefix, I don't know enough about your data. Is a 1 letter entry always a prefix?

You can always use LIKE and % but it will hurt the efficiency of your queries. That may not matter to you.

Dum Spiro Spero

Replies are listed 'Best First'.
Re^4: wild cards in Vertica
by pragov (Novice) on Jun 30, 2015 at 19:20 UTC
    Yes..the prefix is always like A or B or M etc. I tried this way
    if ($clnm ne ""){ $cnt = @parts = split(/\,/, $clnm ); # $clnm = "'"; $WHERE = $WHERE ." AND ("; for ($i = 0; $i < $cnt; $i++) { $WHERE = $WHERE . "m.CLNAME LIKE '$parts[$i]%' "; ($WHERE = $WHERE . " OR ") if ($i < $cnt - 1); } $WHERE = $WHERE . ")"; }
    but still did not work. getting output as: AND m.CLNAME IN (A,BDO-CL1) Should I modify here too?
    if ($clnm ne "") { $Where = $Where . "AND m.CLNAME IN ($clnm) "; }
    Thanks,

      Saying it doesn't work doesn't help. For the THIRD time, please answer my very simple question .. what value do you want to see in $Where?

      Dum Spiro Spero
        I need to see WHERE m.processed_time BETWEEN to_timestamp('20150630003500','YYYYMMDDHH24MISS') AND to_timestamp('20150630020559', 'YYYYMMDDHH24MISS')AND CLName LIKE('A%','MET-CL1',BDO-CL1')