|
| ||||||||||
| Tags: database, like, mysql, operators, windows |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| LIKE statement in MySQL
i want to know about the searching criteria of records from database object in MySQL database.As a new for MySQL,I am going to write a query and I need to add the searching criteria according to the range and case of the record. How can it would be possible.please help me regarding this. Thank. |
|
#2
| ||||
| ||||
| LIKE statement in MySQL
The searching criteria is specified for every database in the database management system.If you didn't specify the matching criteria for records in the database.In case,you can't be facilitate from the database. Different database uses the searching criteria and every one has some little bit changes in the syntax to define them.If we talk about the MySQL database.It uses the LIKE statement to fetch the records from the database tables. |
|
#3
| |||
| |||
| LIKE statement in MySQL
If you need to show all the products from the table "Product_data" that contain the words JACK as the name of supplier.You can use the wildcard search pattern to display the name of that particular person in the table. There are two wildcard characters are used and I think,the popular database also usage the same for pattern matching.The wild card characters are as follows- 1- % (percentage sign character). 2- _ (Underscore character). |
|
#4
| ||||
| ||||
| Use of % Wildcard with LIKE statement Use of % Wildcard : One of the wild card named percentage sign wild card is used to disply The most commonly used wildcard is the percent sign (%).This character is used with the search string, % specifies that match any number of occurrences of any character. For example,A table named Products and contains too many rows and I need to find all the name of products that start with the word MAN. To find that required product,you can use the following SELECT statement: Code: SELECT pd_id, pd_name FROM products WHERE prod_name LIKE 'MAN%'; |
|
#5
| ||||
| ||||
| Use of (_) with LIKE statement Use of Underscore (_) wild card : This is one of the useful wildcard named underscore (_). The underscore is used just like %, but act some different from %. the % matches multiple characters where as the underscore matches within a single character. The example can given below can clarify,what happens behind this.execute the following statement in your MySQL terminal. Code: SELECT pd_id, pd_name FROM products WHERE prod_name LIKE '_MAN'; |
|
#6
| ||||
| ||||
| Accessing cookies using LIKE statement Accessing cookies using LIKE statement If you are using the MySQL as a back end for your web application then you access the cookies of the website that you have developed. The following statement would allow to access the data from cookies of the website. Code: mysql> SELECT * FROM search WHERE Keywords LIKE '%cookies%';
__________________ Grand Theft Auto 4 PC Video Game |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "LIKE statement in MySQL" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unable to install MySQL and MySQL Workbench on Linux mint 10 | Zared | Windows Software | 4 | 13-01-2011 12:08 AM |
| How to use JOIN statement in MySQL | Atsushi | Software Development | 4 | 30-12-2010 05:31 AM |
| mysql config file in MySQL | Netorious | Software Development | 4 | 18-03-2010 09:43 PM |
| Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2 | roshan45 | Software Development | 3 | 07-11-2009 08:36 PM |
| What is the difference between while statement & do statement? | Athos | Software Development | 4 | 25-02-2009 07:52 PM |