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

How to simulate print statement in MySQL?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2023-09-11 21:01:02
forward
1168 people have browsed it

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 ’ ‘;
Copy after login

You can check the above syntax in the MySQL command line client.

Case 1

Print string.

mysql> select 'HELLO MYSQL' as ' ';
Copy after login

Output

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

Case 2

a) To print integers, use the following query-

mysql> select 23 as ' ';
Copy after login

Output

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

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

mysql> select 23.45 as ' ';
Copy after login

Output

+-------+
|       |
+-------+
| 23.45 |
+-------+
1 row in set (0.00 sec)
Copy after login

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 of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template