如何将CONCAT()函数与MySQL WHERE子句一起使用?
假设从表“ Student”开始,我们希望根据条件也是“ Name”,“ Subject”,“ Name”,“ Subject”,通过功能在WHERE子句中提供CONCAT()
。我们可以使用以下查询给出输出-
mysql> Select CONCAT(Name, ' ', 'Resident of', ' ', Address,' ','is',' ', 'Studying',' ', Subject)AS 'Detail of Student' from Student WHERE CONCAT(Name, Subject) = "AaravHistory";+----------------------------------------------+
| Detail of Student |
+----------------------------------------------+
| Aarav Resident of Mumbai is Studying History |
+----------------------------------------------+
1 row in set (0.00 sec)
以上是 如何将CONCAT()函数与MySQL WHERE子句一起使用? 的全部内容, 来源链接: utcz.com/z/358651.html