
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can I simulate a 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)
- Related Articles
- How can I simulate an array variable in MySQL?
- How can we simulate the MySQL INTERSECT query?
- How can we simulate the MySQL MINUS query?
- How can I use MySQL IF() function within SELECT statement?
- How can I describe all tables in the database through a single statement in MySQL?
- How MySQL LEFT JOIN can be used to simulate the MySQL MINUS query?
- How can I get the information about a particular column of a table by MySQL EXPLAIN statement?\nEXPLAIN statement?
- How can we simulate the MySQL INTERSECT query having WHERE clause?
- How can we simulate the MySQL INTERSECT query returning multiple expressions?
- How can I use a SELECT statement as an argument of MySQL IF() function?
- How can I use goto statement in JavaScript?
- How can I see the CREATE TABLE statement of an existing MySQL table?
- How can I use a label with break statement in JavaScript?
- How can I use a label with continue statement in JavaScript?
- How to simulate Print screen button using selenium webdriver in Java?

Advertisements