My subquery in the where clause is returning more than one record. I'm trying to parse out the first name out of a field that has both the first and last name in the field called "FULLNAME".
Code:
Select 0, m.LINK
from MNAMES m
Left Join GEOBASE g on g.LINK = m.LINK
Left Join PHONES p on m.LINK = p.LINK
Left Join Vehicles v on m.LINK = v.OWNER
Where (@FNAME = '-1' OR (Select LTRIM(RTRIM(UPPER(SUBSTRING(FULLNAME,1,LENGTH(@FNAME))))) from mnames where LINK = m.LINK) LIKE @FNAME)