Introduction
In this article, I will explain how to merge multiple rows into a single row using SQL. For this use the following steps.
Step 1: First create the database.
Step 2. Create a table and insert the same values in it.
Step 3. Now to see the table write the following command.
The result that displays the output is as follows.
![pic1.jpg]()
Step 4. Now to merge the data that shows the records for only the userid 1 and 2 into a single row and the date operation write the query as.
Step 5. Select the preceding query and press F5 to run it, the output is displayed like this.
![pic2.jpg]()
Summary
With the help of this article, we can combine multiple rows into a single row based on the values in a column.