ELT(n,string1[,string2,string3...])

Description: Returns string1 if n=1, string2 if n=2, and so on. If n is greater than the number of strings, or less than 1, returns NULL.

Example:

  • ELT(3,'John','William','Smith') returns Smith.

See also: FIELD().

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.