I'm pretty new to MYSQL, and SQL in general. I'm having problems with a query and can't seem to find an answer. Here's my query:
SELECT * FROM user_activity INNER JOIN employee USING(user_id) WHERE ac_ptname LIKE lastName
My problem is the WHERE clause. It only returns an exact match. Smith=Smith, but ac_ptname also has a Smith,John that I expected to be returned also, but was not. What am I doing wrong?
The employee table has 649 records, and three fields (user_id,lastName,firstName). The user_activity table has over 300,000 records and quite a few more fields, however the user_id field is the only one they have in common. The ac_ptname field is a text field where the names are typically last only or "Last,First".
SELECT * FROM user_activity INNER JOIN employee USING(user_id) WHERE ac_ptname LIKE lastName
My problem is the WHERE clause. It only returns an exact match. Smith=Smith, but ac_ptname also has a Smith,John that I expected to be returned also, but was not. What am I doing wrong?
The employee table has 649 records, and three fields (user_id,lastName,firstName). The user_activity table has over 300,000 records and quite a few more fields, however the user_id field is the only one they have in common. The ac_ptname field is a text field where the names are typically last only or "Last,First".