MySQL

R4R® MySQL
(追記) (追記ここまで)
(追記) (追記ここまで)
Wildcard in MySQL

They are the chararcters which provides a easiy way to search any pattern or string in the specified column. Wildcards can be use within two functions only, they are

  1. Like
  2. Rlike

The Like is already discussed in the previous page or you can click on this link

Rlike

It performs some category , whose description is given below in the below table

Type Description
^ Define begining of the string
$ Define ending of the string
| OR Conditions
(追記) (追記ここまで)

Syntax

SELECT * 
FROM tablename 
WHERE Clause 
RLIKE 'type_define';

The '^' defines the starting of the string followed by the character ' s ' define and display all the result.

Example

SELECT *
FROM studinfo 
WHERE lname
RLIKE '^s' ;

The '$' defines the ending of the string followed by the character ' a ' define and display all the result.

Example

SELECT *
FROM studinfo 
WHERE lname
RLIKE 'a$' ;

The '|' defines the OR type in the string and display all the result.

Example

SELECT *
FROM studinfo 
WHERE lname
RLIKE 'sharma|saxena' ;
(追記) (追記ここまで)
Copyright ©2021-22 r4r.co.in, all rights reserved. Theguestspost.com
Sitemap
Career
Post comment
About us
Subscription
Unsubscription

AltStyle によって変換されたページ (->オリジナル) /