Last answered:

07 Jan 2022

Posted on:

07 Nov 2021

1

Resolved: Given solution didn't work and showing error

The solution provided here didn't work it shows
Error Code: 1172. Result consisted of more than one row 
I was able to get output by using limit 1, but what about multiple outputs?

3 answers ( 1 marked as helpful)
Posted on:

19 Nov 2021

0

The issue seems to be with the algorithm itself. Namely, there are several persons in the 'employees' table that share the same full name, so just providing the first and last name is not enough to uniquely identify a person. I guess the point of the exercise was to show how you can have several input parameters.. For example, I found out through some random searches that the name Sumant Peac only occurs once, and with this the procedure runs without a problem.

Instructor
Posted on:

16 Dec 2021

2

Hi Yogesh and Sizar!
Thanks for reaching out.

@: Sizar
Thanks for sharing this piece of information with the Community!
@: Yogesh
This means that there are multiple individuals that share this first and last names while the procedure has been created for individuals that are unique in terms of first-and-last name combination.
In other words, the query works only for unique combinations of first and last name. In case there is more than 1 person bearing the same first and last name (as is the case with Georgi Facello), the query should provide error code 1172: Result consisted of more than one row; which is something a stored procedure can't handle.
In MySQL, the only way to obtain multiple result-sets is to save them in tables and this is something that is beyond the scope of this course.

Hope this helps.
Best,
Tsvetelin

Posted on:

07 Jan 2022

0

Hi Tsvetelin,

You mentioned that the only way to obtain multiple result-sets is to save them in tables, what course here can you suggest for me to take if I want to learn more regarding this matter.
Thank you.
Best,
Christian

Submit an answer