Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"like" comparison on field name (not on a literal) 1

Status
Not open for further replies.

mntech

Programmer
Apr 6, 2004
1
US
I have both a Last_name and a Full_name column on my table. I need to verify that the Last_name is, in fact, also included in the full_name. I tried to use a like operator
(e.g. select * from table where full_name like '%last_name%';) but I am not getting expected results. I think I end up looking for the literal "full_name" instead of for the value in the field.
Does anyone know how to look for the value of one field within another when you don't have a literal?
 
Exactly so.
Code:
'%' + last_name + '%'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top