vendredi 27 mars 2015

Find code in string


Vote count:

0




I have created a table that has a column "code" with an 8-digit (i.e. "8MKL98LO" code and another one, "list_of_codes" with a string of 8-digit codes (i.e. "8MKL98LO", "89FLOP7P"). I need to do a select statement that would tell me whether the first code is included in the other column that has multiple ones.


If I had always the same codes in the second column I could just do something like:


IF(code in ("8MKL98LO", "89FLOP7P"), 1, 0)


but it doesn't work if I try something like:


IF(code in list of codes, 1, 0)


Any suggestions? I feel it should be pretty easy but I can't find a way that works.


Thanks!



asked 36 secs ago







Find code in string

Aucun commentaire:

Enregistrer un commentaire