SQL Wildcards

In this chapter you will learn:
About wildcard
Example of wildcard

About wildcard

SQL wildcard statement is used with like statement to retrieve the specific data from the records. You can display records according to your requirement with the help of wildcards.

Example of wildcard

% (percent)- It matches one or more characters and retrieve the matching value
_ (Underscore)- If any one character matches then the data or value will retrieve otherwise no

Example 1

select * from humanresources.employee where title like 'p%'
like statement example Note:-

In the given example 1, % is wildcard which is used with like statement to retrieve selected data from database.


Example 2
select * from humanresources.employee where title like '%p%'
like statement example2 Note:-

In the given example 2,%% is also a wildcard which is used with like statement to retrieve selected data from the database.


SUMMARY

In this chapter you have learned about wildcard so now it’s your responsibility to use this statement for your practice. In the next chapter you will learn about aliases.

More Articles

 

Share your thought