Home >Database >Mysql Tutorial >How to simulate print statement in MySQL?

How to simulate print statement in MySQL?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBforward
2023-09-11 21:01:021139browse

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.

Case 1

Print string.

mysql> select 'HELLO MYSQL' as ' ';

Output

+-------------+
|             |
+-------------+
| HELLO MYSQL |
+-------------+
1 row in set (0.00 sec)

Case 2

a) To print integers, use the following query-

mysql> select 23 as ' ';

Output

+----+
|    |
+----+
| 23 |
+----+
1 row in set (0.00 sec)

b) To print float or double type, use the following query-

mysql> select 23.45 as ' ';

Output

+-------+
|       |
+-------+
| 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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete