Data Loader

RIGHT function in MSSQL and MySQL

The RIGHT function returns the specified number of characters from right in a given string. It functionality is same in both MSSQL and MySQL

MSSQL

Syntax

RIGHT(String,n) 

Where

string:  Is the characters string from which you want to retrieve rightmost characters
n       :   Is the number of characters you want to retrieve

Example

select RIGHT('This is demo',3)
----------------------

emo

Right Function in MSSQL

 

MySQL

It's similar to MSSQL RIGHT function.

Example

mysql> select RIGHT('This is demo',3);
+------------------------+
| RIGHT('This is demo',3) |
+------------------------+
| emo |
+------------------------+
1 row in set (0.00 sec)

mysql>
right_function_example_mysql
 

Back to Converting Functions from MSSQL to MySQL