Home >Database >Mysql Tutorial >How to simulate print statement in MySQL?
To simulate print statements in MySQL, you can use the select statement. The syntax is as follows -
SELECT ‘anyStringValue’ as ’ ‘;
You can check the above syntax in the MySQL command line client.
Print string.
mysql> select 'HELLO MYSQL' as ' ';
+-------------+ | | +-------------+ | HELLO MYSQL | +-------------+ 1 row in set (0.00 sec)
a) To print integers, use the following query-
mysql> select 23 as ' ';
+----+ | | +----+ | 23 | +----+ 1 row in set (0.00 sec)
b) To print float or double type, use the following query-
mysql> select 23.45 as ' ';
+-------+ | | +-------+ | 23.45 | +-------+ 1 row in set (0.00 sec)
The above is the detailed content of How to simulate print statement in MySQL?. For more information, please follow other related articles on the PHP Chinese website!