MySQL If Else condition in Select

IF Else condition in query is quite interesting and it is very useful in some cases. It reduces two queries to single one. Syntax IF(Statement, TRUE block, FALSE block) It works like usual If Else condition..

Read More » Posted on 2016-04-09 03:52:47

MySQL SQL

MySQL If Else condition in Where clause

If Else is slightly similar to OR condition in MySQL. But, here it checks the Statement and go to TRUE Block or FALSE Block. Syntax WHERE IF(Statement, TRUE block, FALSE block) Example Here is the..

Read More » Posted on 2016-04-06 03:12:04

MySQL SQL

MySQL Increment value by N

This is a simple query to increment row value in MySQL. And this eliminates the need of code in php or other server side scripts. Syntax UPDATE tablename SET column_name=column_name + N where clause..

Read More » Posted on 2016-04-05 03:01:27

MySQL SQL