Database - Introduction to SQL - Discussion
Discussion Forum : Introduction to SQL - General Questions (Q.No. 11)
11.
The SQL keyword(s) ________ is used with wildcards.
Discussion:
14 comments Page 1 of 2.
Argha Sarkar said:
5 years ago
Thank you.
Sufi said:
6 years ago
Thanks, Now my doubt on wildcard is much cleared.
Ramesh said:
7 years ago
Wildcard is special character is represent to another character.
Like as run* -->then result get out run, runing, runs.
Like as run* -->then result get out run, runing, runs.
Gayatri said:
7 years ago
A wildcard character can be used to substitute for any other character(s) in a string. SQL wildcards are used to search for data within a table.
For Example1:
SELECT * FROM Customers
WHERE City LIKE 'ber%';
//Displays table containing city starting with Ber...//
For Example2:
SELECT * FROM Customers
WHERE City LIKE '%es%';
//Displays table containing city ending with es...//
For Example1:
SELECT * FROM Customers
WHERE City LIKE 'ber%';
//Displays table containing city starting with Ber...//
For Example2:
SELECT * FROM Customers
WHERE City LIKE '%es%';
//Displays table containing city ending with es...//
Lalitha said:
8 years ago
This notes really help to know about wild cards in SQL.
Divya said:
9 years ago
If you want to select persons name from persons table ending with d and starting with m,
Then use the syntax like this,
select * from PERSONS where personname like 'm%d';
Ex: mad, mohammad, married, mustard, etc.,
And to retrieve persons name where 5th letter is d and 7th letter is s and after s you can have any characters, then use,
select * from PERSONS where personname like '_ _ _ _ d_s%'
Ex: kalidas.
Then use the syntax like this,
select * from PERSONS where personname like 'm%d';
Ex: mad, mohammad, married, mustard, etc.,
And to retrieve persons name where 5th letter is d and 7th letter is s and after s you can have any characters, then use,
select * from PERSONS where personname like '_ _ _ _ d_s%'
Ex: kalidas.
Ali said:
9 years ago
Using the _ Wildcard.
Now we want to select the persons with a first name that starts with any character, followed by "la" from the "Persons" table. We use the following SELECT statement:
SELECT * FROM Persons WHERE FirstName LIKE '_la'
Now we want to select the persons with a first name that starts with any character, followed by "la" from the "Persons" table. We use the following SELECT statement:
SELECT * FROM Persons WHERE FirstName LIKE '_la'
Vikas said:
1 decade ago
Like keyword used two wildcard 1. '_' for single character, 2. '%'for multiple character.
Shikha said:
1 decade ago
Yes @baburao and @bipin explained this very closely. Thats right and I agree with them.
Bipin said:
1 decade ago
Wildcard means %text enclosed with single quote.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers