如何在 MySQL WHERE 子句中使用 CONCAT_WS() 函式?
當我們在 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)
廣告