
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Simulate Print Statement in MySQL
To simulate a print statement in MySQL, you can use select statement. The syntax is as follows −
SELECT ‘anyStringValue’ as ’ ‘;
You can check the above syntax at the MySQL command line client.
Case 1
To print a string.
mysql> select 'HELLO MYSQL' as ' ';
Output
+-------------+ | | +-------------+ | HELLO MYSQL | +-------------+ 1 row in set (0.00 sec)
Case 2
a) To print integer, 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)
Advertisements