The IS_MEMBER_OF row function takes an atomic value and a set, and returns a Boolean indicating whether the atomic value occurs in the set.
IS_MEMBER_OF(<atomic-value>, <set>)where:
IS_MEMBER_OF(1, { }) = FALSE IS_MEMBER_OF(1, { 1, 2, 3 }) = TRUE IS_MEMBER_OF(1, { 2, 3, 4 }) = FALSE IS_MEMBER_OF(NULL, { }) = NULL IS_MEMBER_OF(NULL, { 1, 2, 3 }) = NULL IS_MEMBER_OF(1, { 'a', 'b', 'c' }) yields a checking error because the atomic value and the set elements are not of the same data type
The IS_MEMBER_OF function is intended as a membership check function.
RETURN results AS SELECT WineID AS idRec, IS_MEMBER_OF(82, Score) AS memberAttrs FROM WineState WHERE WineID BETWEEN 22 AND 25 ORDER BY idRec
idRec memberAttrs -------------- | 22 | false | | 23 | true | | 24 | false | | 25 | true | --------------
The results show that the number 82 occurs in the Score set of Records 23 and 25, but not in Records 22 and 24.
RETURN results AS SELECT WineID AS idRec, IS_MEMBER_OF(Ranking, Score) AS memberAttrs FROM WineState ORDER BY idRec
RETURN results AS SELECT WineID AS idRec, Price AS prices FROM WineState WHERE IS_MEMBER_OF(Ranking, Score) AND Price IS NOT NULL ORDER BY idRec
RETURN results AS SELECT WineID AS idRec, Price AS prices FROM WineState WHERE Ranking IN Score AND Price IS NOT NULL ORDER BY idRec
For details on the IN expression, see IN.