top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How do we use % when performing a search query?

+4 votes
77 views
How do we use % when performing a search query?
posted Jun 22, 2016 by Vrije Mani Upadhyay

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes
 
Best answer

For example you run this query

mysql> select * from mytable where mycolumn like '%mytext%';

Above query will return you all the rows where mycolumn is containing mytext i.e. It will return a row which contains
abcmytextabc,
abcmytext
mytextabc

So in short % works as wildcard character in the same way how * works in linux.

answer Jun 22, 2016 by Salil Agrawal
...