Computer >> Computer tutorials >  >> Programming >> MySQL

How does MySQL QUOTE() function work with comparison values?


When QUOTE() function used with WHERE clause then the output depends upon the comparison values returned by WHERE clause. Following example will exhibit it −

Example

mysql> Select Name, ID, QUOTE(Subject)AS Subject from Student WHERE Subject = 'History';

+-------+------+-----------+
| Name  | ID   | Subject   |
+-------+------+-----------+
| Aarav | 2    | 'History' |
+-------+------+-----------+

1 row in set (0.00 sec)