MAKE_SET(bits,string1[,string2...])

Description: Returns a string set (a string consisting of a set of comma-separated values), composed of string1, string2, and so on, according to the bits that are set to 1 in the binary representation of bits.

Note that string1 corresponds with bit 0 of bits (the least significant). Any NULL strings are ignored.

Examples:

  • MAKE_SET(1,'John','William','Smith') returns John.

  • MAKE_SET(2,'John','William','Smith') returns William.

  • MAKE_SET(4+1,'John','William','Smith') returns John,Smith.

  • MAKE_SET(15,'John','W',NULL,'Smith') returns John,W,Smith.

See also: EXPORT_SET(), FIND_IN_SET()

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.