HOW TO USE LIKE OPERATOR IN MSSQL

in #sql8 years ago

Step 1 :

Create database BMC

Step 2:

create table Client_table_news

(

Cids bigint,

Cname varchar(50),

Ccity varchar(200),

CPrice float

);

Step 3 :

Insert Into Client_table_news values(1,'VIRAJ','MUMBAI',15000.00)

Insert Into Client_table_news values(2,'RAJ','DELHI',10000.00)

Insert Into Client_table_news values(3,'ANIL','PUNE',12000.00)

Insert Into Client_table_news values(4,'SUNIL','MUMBAI',9000.00)

Insert Into Client_table_news values(5,'SHERYAS','JAIPUR',11000.00)

Insert Into Client_table_news values(6,'AJAY','MUMBAI',16000.00)

select *from Client_table_news

Step 4 :

SELECT *FROM Client_table_news 

WHERE Ccity LIKE 'M%';

SELECT *FROM Client_table_news 

WHERE Ccity LIKE '%I';

SELECT * FROM Client_table_news

WHERE Ccity LIKE '%MUM%';

SELECT * FROM Client_table_news

WHERE Ccity LIKE '_UM%';

SELECT * FROM Client_table_news

WHERE Ccity LIKE 'M_%_%';

SELECT * FROM Client_table_news

WHERE Ccity LIKE 'M%I';

SELECT * FROM Client_table_news

WHERE Ccity NOT LIKE 'M%';



If You Haven't Subscribers My Channel Than Please Subscribers It And Even Share It Link Of My Channnel :- https://www.youtube.com/channel/UCdIDIGUh3rL9A_Yt_tbZmkg Please Go And Subscribers It
Sort:  

Hello! Your post has been resteemed and upvoted by @ilovecoding because we love coding! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!

Reply !stop to disable the comment. Thanks!

If You Haven't Subscribers My Channel Than Please Subscribers It And Even Share It Link Of
My Channnel :- https://www.youtube.com/channel/UCdIDIGUh3rL9A_Yt_tbZmkg Please Go And Subscribers It

Coin Marketplace

STEEM 0.04
TRX 0.33
JST 0.096
BTC 62119.69
ETH 1735.64
USDT 1.00
SBD 0.39