如何将CONCAT_WS()函数与MySQL WHERE子句一起使用?

2023年12月5日11:59:38

当我们在WHERE子句中使用CONCAT_WS()函数时,输出将基于WHERE子句中提供的条件。从“学生”表的示例可以理解如下

示例

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)

  • 更新时间:2023年12月5日11:59:38 ,共 557 字。