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 is Name and ...

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 products. id name price 43245 Jeans 19.99 43246 Top 3.99 43247 Playstation 89.95 43248 Men’s ...

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 ...

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 ...
© 2017 Sumit Bansal. All rights reserved. Site Admin · Entries RSS · Comments RSS
Powered by WordPress · Designed by Theme Junkie