Search Posts

Need to string comparision in MYSQL

how to – Need to string comparision in MYSQL

I have two varchar variables.

DECLARE val1 VARCHAR(100) DEFAULT '1,2,3';
DECLARE val2 VARCHAR(100) DEFAULT '1,2';
DECLARE result VARCHAR(100) ;

SET result= val1 compare val2;

Expectation:
result=’3′

My expectation is possible in MYSQL,If yes please guide me

Source: Stackoverflow

Leave a Reply

Your email address will not be published. Required fields are marked *