假设从表“ 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)