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

When to Use Single Quotes, Double Quotes, and Backticks in MySQL

In this post, we will get to know When to use single quotes , double quotes, and backticks in MySQL there are these three types of quotes in MySQL that we use for enclosing the strings at different parts of the time when we need here we will learn the different uses of each quote … Read more

Insert Into A MySQL Table Or Update If Exists

In this tutorial we will learn Insert Into A MySQL Table Or Update If Exists there is a command to insert the data in a table that is insert into table and to update the table we use update command to update it. Insert A New Record In to Table Insert is a command which … Read more

MySQL – Update query based on SELECT Query

In this tutorial, we will discuss MySQL – Update query based on SELECT Query where both Update and select queries are DML Data Manipulation Languages. where we deal with the data and we manipulate, add, update, or select and display the data as per our choice. Update Command The update command is used for making … Read more

How To Create A Table In New Database.

In this tutorial, we will learn How To Create A Table In New Database where we use DDL Data definition language to create the table using create table clause and by providing the name of the column along with the data type that we want to store in that w=and the size of what that … Read more

%d bloggers like this: