4
votes
2answers
59 views

List minutes instead of grouping by them

Looking how to list minutes 1 to 120 from a 2 hour interval timestamp field instead of getting each minute from both hours together. What I want is something like this: min COUNT(*) 1 ...
1
vote
1answer
142 views

Difference between now() and current_timestamp

In PostgreSQL, I use the now() and current_timestamp function and I see no difference: # SELECT now(), current_timestamp; now | now ...
0
votes
1answer
466 views

Why are timestamps not always increasing with concurrent inserts?

I'm seeing some unexpected behavior with timestamp (rowversion) columns . I created a test table: create table Test ( Test_Key int identity(1,1) primary key clustered, Test_Value int, ...
1
vote
1answer
2k views

Why does mysql adds a default timestamp on insert/update even if I did not specify anything?

I have a table that is as follows: CREATE TABLE SomeTable ( id int unsigned NOT NULL AUTO_INCREMENT, status enum('broken','repaired') NOT NULL, from datetime NOT NULL, until ...
0
votes
1answer
91 views

Different time in different sessions

I am connecting to same db from 2 different machines using SQL Developer and querying a table which stores timestamp. But to my surpise the time value returned by query has a gap of one hour on ...
1
vote
1answer
49 views

Script to get duration

I am new to PostgreSQL. I am trying to write a query which can give me duration of the time. The fields are in the format yyyymmddhhmmss. In between we will get empty fields for Start_Time or ...
5
votes
3answers
570 views

“AT TIME ZONE” with zone name PostgreSQL bug?

I was answering this stackoverflow question and found strange result: select * from pg_timezone_names where name = 'Europe/Berlin' ; name | abbrev | utc_offset | is_dst ...
3
votes
1answer
349 views

Retrieving queries when the hour of starting timestamp is less than the hour of ending timestamp

I have a CTE-based query in which I retrieve hourly intervals between two given timestamps. My query works as following: Getting start and end datetimes (let's say 07-13-2011 10:21:09 and 07-31-2011 ...
1
vote
2answers
1k views

LEFT JOIN conversion to INNER JOIN, can't change FROM clause

I have 2 tables: BASE is master and is linked with CHILD via field ID: Left outer Join / 1:N relation. These 2 tables contain historised data, defined by 2 date-fields: start_date and end_date. ...
2
votes
1answer
4k views

Compare a date and a timestamp with time zone with now() in the same query?

I have multiple database servers I'm querying with a query that compares an expiration column with now(). The problem is that one of the servers' expiration column is a timestamp with time zone, and ...