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.
Mani said:
1 decade ago
Wildcard means?
Neha goyal said:
1 decade ago
What is wildcard ?
BabuRao said:
1 decade ago
Wildcard means %text enclosed with single quote.
ex: cname like '%BU'
ex: cname like '%BU'
Prabhakar said:
1 decade ago
Thanks it is useful.
Bipin said:
1 decade ago
Wildcard means %text enclosed with single quote.
Shikha said:
1 decade ago
Yes @baburao and @bipin explained this very closely. Thats right and I agree with them.
Vikas said:
1 decade ago
Like keyword used two wildcard 1. '_' for single character, 2. '%'for multiple character.
Ali said:
1 decade 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'
Divya said:
1 decade 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.
(2)
Lalitha said:
1 decade ago
This notes really help to know about wild cards in SQL.
(1)
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers