How can CONCAT_WS() function be used with MySQL WHERE clause?

MySQLMySQLi Database

When we use CONCAT_WS() function with WHERE clause then the output would be based upon the condition provided in WHERE clause. It can be understood from the example of ‘Student’ table as follows

Example

mysql> Select CONCAT_WS(' ',Name, Last_name, 'Resident of', Address, 'is studying', Subject)AS 'Student Detail' from student WHERE id = 20;
+----------------------------------------------------------------+
| Student Detail                                                 |
+----------------------------------------------------------------+
| Gaurav Rathore Resident of Jaipur is studying Computers        |
+----------------------------------------------------------------+
1 row in set (0.00 sec)
raja
Published on 20-Feb-2018 05:52:13
Advertisements