devxlogo

MySQL

Understanding the REPLACE Command in MySQL

At times, it is necessary to replace full or partial value in a column. The following command will be handy in achieving the this result. UPDATE TABLE_NAME SET COLUMN_NAME =

Temporary Tables in MySQL

We may want to use a table to store values while computing, which in turn might be used by subsequent processing. But, for sure, this working data must not be

Understanding the GRANTS for the Current User in MySQL

The command “SHOW GRANTS” will display the privileges that the current user has. Command: SHOW GRANTSSample output:+——————————————————————————————————————+|Grants for dbuser@% |+——————————————————————————————————————+| GRANT ALL PRIVILEGES ON *.* TO ‘dbuser’@’%’ IDENTIFIED BY PASSWORD

Finding the Difference Between 2 Dates in MySQL

MySQL provides a function DATEDIFF?that takes two arguments, first date and the second date. The function computes the difference between them and returns a positive result if the first date