Good Morning,

Hopefully someone can help me with a quick answer.

I have a transaction table with a 'description' column that contains a combination of the members name and some static information i.e. "'username' PURCHASE" or "'username' PAYMENT"

and a 'type' column that contains various types of transactions i.e. 'FEE' or 'EARN'

I have a list of usernames, and I need to get the transaction number from each of these records where the 'description' contains a username from the list and the 'type' ='FEE'.

I don't know how to use the LIKE with the % wildcard along with the IN (using a list)

Any help would be greatly appreciated.


4 Years
Discussion Span
Last Post by showman13
Featured Replies
  • not 100% on what you're looking at (seeing the table structure would help) .. `explain TABLENAME` or `show create table TABLEANME`. but here goes... SELECT [COLUMNS_NAMES] FROM [TABLENAME] WHERE DESCRIPTION LIKE "%searchterm%" AND type IN ('FEE', 'EARN') hope this helps. cheers. Also, Mysql has a great refernece on their website … Read More


select * from table
where DESCRIPTION LIKE "%searchterm1%" or
DESCRIPTION LIKE "%searchterm2%" or
DESCRIPTION LIKE "%searchterm3%" or
DESCRIPTION LIKE "%searchterm4%"


Thank you both for your responses...

Sorry for the long delay, but I got sidetracked again and emursed in another project.

On this question, I concluded it wasn't worth the time or struggle to find a cure for it, because it would be a one time use and the total number of records effected was under 100, so I just went through them one by one manually and made the necessary adjustments.

Thanks again for the responses, but I'm going to mark this as solved .

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.