MySQL Forums
Forum List  »  Newbie

Re: reducing the like condition
Posted by: Rick James
Date: May 23, 2016 04:16PM

This will run a bunch of counts at the same time:

SELECT
SUM(cat_name like '%PC Laptops & Netbooks%'),
SUM(cat_name like '%C Laptops & Netbook%'),
SUM(cat_name like '% Laptops & Netboo%'),
SUM(cat_name like '%Laptops & Netbo%'),
SUM(cat_name like '%aptops & Netb%'),
SUM(cat_name like '%ptops & Net%')
FROM `categories`;

Give it a try.

Why do you want to minimize the string?

Options: ReplyQuote


Subject
Written By
Posted
Re: reducing the like condition
May 23, 2016 04:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.