|
|
Selecting rows containg a string of specified value length - Mysql
|
Views : 349
|
|
Tagged in : Mysql
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
Lets consider a employee table with name as a column in it.
If we need to select and see only employees with name have five letters we can use wither of the following option
Using LENGTH function:
select * from employees where LENGTH(name) = 5;
Using Regular Expression:
select * from employees where name like '______';
In the above query we have used 5 "_" (underscores).
Each underscore points to one character
|
|
By rajesh, On - 2009-10-31 |
|
|
|