MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

DATABASE & SQL/PLSQL

Displaying Rows Using String Operator
Previous Home Next

Using String Operator

String operator provide a LIKE keyword to search for a string with wild card mechanism.

DtatypeRange
%Represents any string of Zero or more character
_Represent the single character
[]Represent any single character within the specified range
[^]Represent any single character not within the specified range

 

Example:

SELECT *
FROM titles
WHERE type LIKE 'bus%'

Return all attribute from the titles table in which the type starts with 'bus'

SELECT *
FROM titles
WHERE type LIKE 'bu_'

Return all attribute from the titles table in which the type of book is the three character long and  starts with 'bu'. Increase the '_' keyword increase the number of characters.

SELECT *
FROM titles
WHERE type LIKE 'b[us]%'

Return all attribute from the titles table in which the type of book is starts with 'b' and contain u and s on the second position followed by any number of character.

SELECT *
FROM titles
WHERE type LIKE 'b[^s]%'

Return all attribute from the titles table in which the type of book is starts with 'b' and does not contain s on the second position followed by any number of character.

Some Example

ExpressionReturns
LIKE '%ty%' All names that have the letters 'ty' in them
LIKE '_ty'All three letter names ending with 'ty'
LIKE '[AD]%'All name that begin with "A" or "K"
Previous Home Next