-4

Similar to this question, can we use the pattern:

CONSTRAINT chk_X CHECK (X IN (...))

For any SQL data type? E.g.:

CONSTRAINT chk_SomeIntField CHECK (SomeIntField IN (1,2,3,4))

Where SomeIntField is an INTEGER?

jarlh
  • 42,561
  • 8
  • 45
  • 63
Rob Murray
  • 1,773
  • 6
  • 20
  • 32

1 Answers1

2

You can use this for any data type that supports IN. So it works for strings, numbers, and date/time values.

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786