MySQL – Rows to Columns Conversion

In this post, we will learn how to convert Rows to columns and columns into row which we can do using transpose where each row is restored as a column for the same we have given an example where we have transposed the table. Rows To Column Conversion Let’s take an example of the given … Read more

Using LIMIT within GROUP BY to get N results per group?

In this Post, Using LIMIT within GROUP BY to get N results per group whereas in MySQL limit is used for filtering or restricting the data to display where we can limit the data as per our choice where we can restrict the number of rows given by a query more over we can use … Read more

JOIN | How can I do a FULL OUTER JOIN in MySQL?

In this post, we will learn How can I do a FULL OUTER JOIN in MySQL where joins are being used for filtering the data or making some restrictions over the data which helps in restricting the data during the display of the data from two different tables in case of Relational database management System( … Read more

How To Create A MySQL Hierarchical Recursive Query?

In this tutorial, we will learn How to create a MySQL hierarchical recursive query which is also called as CTE ( Common Table Expressions) moreover for achieving it we can also use CTE and UNION All statements for a recursive query that has a self-referencing foreign key relationship.   Hierarchical Recursive Moreover, we have given … Read more

How to Retrieve The Last Record in Each Group – MySQL

In this post, we will learn about Retrieve the last record in each group in MySQL which we can perform using the group by clause and max function The basic idea is to group the records by a certain attribute and then find the maximum values which could be from the primary key( where we … Read more

How can I return pivot table output in MySQL?

In this tutorial, we will learn How can I return Pivot table output in MySQL although we do not have a pivot function in MySQL as some other database has we can always achieve the same using some other method which could be the same as of pivot function using aggregate function and conditional function. … Read more

How to Select Only Rows With Max Value On A Column in SQL?

In this post, we will learn how to SQL select only rows with max value on a column which we can perform using two different methods, Using subquery and self- join, Which we will discuss here one by one with examples of code( Commands). Different Ways to Get Max Values There are different ways to … Read more

%d bloggers like this: