Hi Priya,
In your function, there is a select query with a Where clause. It must be returning multiple records based on the search and where conditions.
Try to implement like this:
select TOP 1 first_name + last_name as 'Name' from GeneralDetails where first_name like '%b%'
It should resolve the error, but not exactly the answer that you need here. The where condition (also generally called as 'Clause') is not limiting the search to only 1 record here, instead fetching all the records which has 'b' in the first_name column.
Say if the letter 'b' exists in 2 or more records, the search query returns a table but the function can only returns a varchar.
Hope you understood the issue.
Have fun with coding...!
Regards,
Vamsi