SELECT *
FROM cdr
WHERE DATEDIFF( NOW( ) , calldate ) =5
select fields that have 5 days old
jueves, 28 de enero de 2016
martes, 26 de enero de 2016
mysql group by
SELECT DISTINCT COUNT( * ) , phone
FROM calls
GROUP BY phone;
FROM calls
GROUP BY phone;
lunes, 25 de enero de 2016
importing table to a database
mysql -p1982 dialer <dialer.sql
How to select records from last 24 hours using SQL?
I am looking for a
where clause that can be used to retrieve records for the last 24 hours? | |||||
|
| |||||||||
|
In
MySQL :
In
SQL Server :
In
Oracle :
In
PostgreSQL :
In
Redshift :
In
SQLite :
In
MS Access :
| |||||||||||||
|
MySQL :
The INTERVAL can be in YEAR, MONTH, DAY, HOUR, MINUTE, SECOND
For example, In the last 10 minutes
| |||
Which SQL was not specified, SQL 2005 / 2008
If you are on the 2008 increased accuracy date types, then use the new sysdatetime() function instead, equally if using UTC times internally swap to the UTC calls.
| |||
in postgres, assuming your field type is a timestamp:
| |||
| |||
| |||
Suscribirse a:
Entradas (Atom)