Category: MySql

Mysql if condition in update query 0

Mysql if condition in update query

We can use the IF CONDITION in update query, given blow example will show how we can use the IF Condition in update query. Suppose we have a table that has 2 column first...

Calculate average and sum from Mysql query 0

Calculate average and sum from Mysql query

The AVG function return the average value of the specified column. For example I have a table of product list and now I want the total of price and average price of all the...

What is the difference between MyISAM and InnoDB? 0

What is the difference between MyISAM and InnoDB?

The main difference between mysql table type MyISAM and InnoDB is that InnoDB supports transaction by MyISAM does not. MyISAM support full text search but InnoDB does not. InnoDB supports some new features: Transactions,...

How to calculate difference in days between two dates in MySQL 0

How to calculate difference in days between two dates in MySQL

Let’s say we have a MySQL table where one column (date or datetime type) is named creation-date and contains dates in one of the YYYY-MM-DD or YYYY-MM-DD HH:MM:SS formats from the past and we...