Questions tagged [sql-timestamp]

263 questions
-1
votes
1 answer

Using two timestamp columns in SQL to generate counts at a "point-in_time"

I have a Postgres database with a ticket table. Each ticket has a 'created_at' timestamp and a 'resolved_at' timestamp. I would eventually like to create a time series visualization to track the number of 'unresolved' tickets over time. For example,…
jjl_1994
  • 13
  • 2
-1
votes
1 answer

Timestamp problem in mediawiki after upgrade to 1.32

after update from 1.28 to 1.32: link of 1.32 :http://wikijoo.ir/32 link of 1.28:http://wikijoo.ir 1.32.0 PHP 7.0.33-0ubuntu0.16.04.5 (apache2handler) MySQL 5.7.25-0ubuntu0.16.04.2 ICU 55.1 Lua 5.1.5 MediaWiki internal error. Original exception:…
-1
votes
1 answer

How to compare dates and times in Yii 2 ActiveRecord?

Im totally confused, how can i compare dates and times in Yii ActiveRecord? I have this method in my model: public static someMethod(){ self::updateAll(['status' => SomeModel::STATUS_ACTIVE], [ 'status' => SomeModel::STATUS_ONLINE, …
BPS
  • 1,133
  • 1
  • 17
  • 38
-1
votes
1 answer

How to change TO_DAYS and CURRENT_DATE to another calendar in mysql?

There are two methods in mysql to get current date. TO_DAYS() // Return the date argument converted to days Reference CURRENT_DATE() // Synonyms for CURDATE() Reference Here's the question: Is it possible to change CURRENT_DATE to another…
Reza DAskov
  • 65
  • 1
  • 10
-2
votes
1 answer

top 100 users online since yesterday postgres

Here's another fun query i found to train SQL for product interviews. I am really doubtful about it tho - given the following table tab_a: user_id, date (they entered platform) find the top 100 users with the longest continuous streak of visiting…
Tytire Recubans
  • 967
  • 10
  • 27
-2
votes
1 answer

How to find all the timestamp values interval by each minute between the two timestamp records

I have a table having three fields Id (Integer) - Unique, Open Date (Datetime), Close Date(DateTime): Id Open Date Close Date 1 2019-07-03 16:28:39.497 2019-07-04 16:28:39.497 2 2019-07-04 15:28:39.497 2019-07-05…
-3
votes
1 answer

SQL Server Integer to Time

I came into a scenario where table containing the time values in integer datatype and I need to convert them to TIME datatype to use DATEDIFF() function. Ex: if column value is 449, then it's 04:49:00:00; if the column contains 25, then…
1 2 3
17
18