in_mixed.sql 480 B

123456789101112131415161718192021
  1. --!syntax_pg
  2. -- simple case
  3. select 1 in ('1', '2');
  4. -- splits into IN over numerics and IN over text
  5. select '1' in (0, 0.0, 1, '1'::text, '3'::char(3));
  6. -- mixture of types in rhs, expression in lhs
  7. select (c::int + 1) in (1, 2.9, '4') from (values ('0'), ('1')) as t(c);
  8. -- arrays support
  9. select array[1, 2] in (array[2, 4], array[1, 2]);
  10. -- NULL in rhs
  11. select 1 in (0, NULL);
  12. select 1 in ('1', NULL);
  13. -- non-PG types handling
  14. select index in ('2', 4) from plato."Input";