Skip to content
Advertisement

Error when using function: The used SELECT statements have a different number of columns

In my MySQL database I have defined a function called isUserVerified that return the status of a user.

I am trying to use the function in a SQL statement:

But I get the following error:

1222 – The used SELECT statements have a different number of columns

This is my function definition:

What am I missing?

Advertisement

Answer

You are selecting two columns but inserting into only one variable. Presumably, you intend:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement