0

I saw in other posts that we can do this with the FIELD() function in MySQL. I am wondering if there is an equivalent of FIELD() in presto. Thank you very much.

Isa
  • 353
  • 2
  • 18

1 Answers1

0

Don't use in. I would recommend join with values:

select t.*
from t join
     (values (1, 'val1'), (2, 'val2'), (3, 'val3')) v(ord, val)
     on t.col = v.val
order by v.ord;
Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786