Search
 
SCRIPT & CODE EXAMPLE
 

SQL

timestamp difference sql

This function in MySQL is used to "return a value after subtracting a DateTime expression from another".
#TIMESTAMPDIFF(unit,expr1,expr2)

unit- It denotes the unit of the result.
        MICROSECOND, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR
Exp1- First date or DateTime expressions.
Exp2- Second date or DateTime expressions.

select TIMESTAMPDIFF(month,'2022-06-14','2022-06-28') as MONTHDIFF
Comment

PREVIOUS NEXT
Code Example
Sql :: select database in mysql 
Sql :: oracle group 
Sql :: delete * from where id = 1; 
Sql :: oracle enable chain 
Sql :: oracle sql number to varchar2 
Sql :: mysql on duplicate key ignore 
Sql :: select all tables linked server sql 
Sql :: oracle sql average 
Sql :: mysql count unique in group statement 
Sql :: between vs in sql 
Sql :: postgresql database url 
Sql :: postgresql backup and restore globals and data 
Sql :: sql search all tables for attributes 
Sql :: how to check which sp is running in sql server 
Sql :: sql rename table 
Sql :: rand mysql 
Sql :: postgres having 
Sql :: bigquery current time 
Sql :: install mysql in ubuntu 18.04 
Sql :: sql remove duplicate 
Sql :: oracle find foreign key dependencies 
Sql :: close external port 3306 with iptables 
Sql :: inner join mysql 
Sql :: Write SQL in ruby on rails 
Sql :: drop procedure if exists sql server 
Sql :: how to check default value of column in sql server 
Sql :: sql drop all tables 
Sql :: SQL get max per id 
Sql :: mysql custom sort order 
Sql :: procedure syntax 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =