How To Use Wildcard Characters in MySQL statements

Share on facebook
Facebook
Share on google
Google+
Share on twitter
Twitter
Share on linkedin
LinkedIn

You’ll need to make use of wildcard characters to perform powerful searches in MySQL. The 2 wildcard characters that you can use in “LIKE”-queries in MySQL are:

% which matches 0 or more characters
_ which matches exactly one character

To search for a date, you can use a query like the following, which gives you everything that happened from 10 to 19 August of 2015, between 9:01am to 9:09am.

SELECT * FROM `yourTable` WHERE `datetime` LIKE ‘2015-08-1_ 09:0%’

Similar Posts:

More to explorer

how i started being a minimalist

How I Started Being A Minimalist

Once, I thought that all that mattered in life were the things that you possessed. Things like your car, house, watch, clothes.

Leave a Reply

Your email address will not be published. Required fields are marked *