AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Mysql like wildcard12/15/2023 INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1012, 'Preety Tiwary', 'HR', 55000, 'Female', 28, 'Mumbai') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1011, 'Pramod Panda', 'IT', 45000, 'Male', 27, 'Mumbai') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1010, 'Hina Sharma', 'HR', 75000, 'Female', 26, 'Mumbai') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1009, 'Pranaya Kumar', 'IT', 50000, 'Male', 28, 'Mumbai') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1008, 'Sambit Mohanty', 'IT', 50000, 'Male', 28, 'Mumbai') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1007, 'Priyanla Dewangan', 'HR', 45000, 'Female', 27, 'Mumbai') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1006, 'Anurag Mohanty', 'IT', 35000, 'Male', 25, 'Mumbai') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1005, 'Linda Jones', 'HR', 75000, 'Female', 26, 'London') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1004, 'Mike Walker', 'Finance', 50000, 'Male', 28, 'London') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1003, 'James Brown', 'Finance', 50000, 'Male', 28, 'London') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1002, 'Mary Smith', 'HR', 45000, 'Female', 27, 'London') INSERT INTO employee (Id, `Name`, Department, Salary, Gender, Age, City) VALUES (1001, 'John Doe', 'IT', 35000, 'Male', 25, 'London') Please use the following SQL Script to create the company database and employee table with the required records. We are going to use the following Employee table to understand the LIKE Operator. Let us understand LIKE Operator in MySQL with Examples. Syntax: Expression LIKE pattern, where expression is the specific column of the table, the pattern is the character expression that contains pattern matching and escape_character is used to check the wildcard characters like % or _. SELECT * FROM Employee WHERE name LIKE ‘%P’ Here the percentage sign is a wildcard character. Here is an example of LIKE operators in SQL statements, The LIKE operator is written as a word “LIKE” followed by a pattern to match with column values. The string pattern contains wildcard characters that represent missing characters. The LIKE Operator in MySQL is basically used with the WHERE clause to search for a specific pattern in a string. At the end of this article, you will understand LIKE, NOT LIKE operators along with the Wildcard Characters available in MySQL with examples. Please read our previous article where we discussed Logical AND, OR & NOT Operators in MySQL. In this article, I am going to discuss Like Operator in MySQL with Examples.
0 Comments
Read More
Leave a Reply. |