Meaning "?" in mysql query
2 answers
?
is a placeholder for parameter values ββin the syntax for prepared statements . The linked article gives the following example:
mysql> PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
mysql> SET @a = 3;
mysql> SET @b = 4;
mysql> EXECUTE stmt1 USING @a, @b;
+------------+
| hypotenuse |
+------------+
| 5 |
+------------+
mysql> DEALLOCATE PREPARE stmt1;
Since you also noted sql, it deserves a reference to the prepared statement Wikipedia article for further reading regardless of MySQL.
+8
source to share
In mysql, a ?
is a placeholder in a prepared post . It will be replaced with any value associated with the client before executing the statement.
+3
source to share