
- 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 we use MySQL self-computed output from any expression, function etc. for inserting values in a row?
While inserting the values in a row, we can use the value of self-computed output from any expression, function etc. Here is an example to demonstrate it −
mysql> Insert into employee(id, emp_name)Select 1+1, Concat_ws(' ','Gaurav', 'Kumar'); Query OK, 1 row affected (0.04 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> Select * from employee; +------+--------------+ | id | emp_name | +------+--------------+ | 2 | Gaurav Kumar | +------+--------------+ 1 row in set (0.00 sec)
- Related Articles
- How can we insert values into a table with the help of MySQL self-computed output?
- How can we fetch a particular row as output from a MySQL table?
- What is the way to get self-computed output from MySQL without a dummy table named dual?
- Can we skip a column name while inserting values in MySQL?
- How can we use MySQL POWER() function with the column’s data values?
- How can we use MySQL SUM() function?
- Can we use INTERVAL keyword while inserting date records in a MySQL table?
- How can we delete a single row from a MySQL table?
- In MySQL, how we can get the total value by category in one output row?
- How can I use MySQL IN() function to compare row constructors?
- How can we update any value in MySQL view as we can update the values in MySQL table?
- How can we return multiple values from a function in C#?
- How can we use a MySQL stored function in a database query?
- How can we use MySQL function STR_TO_DATE(Column, ‘%input_format’)?
- How can we return multiple values from a function in C/C++?

Advertisements