281 questions
2
votes
2
answers
225
views
Generated column with data type timestamptz (timestamp with time zone)
In PostgreSQL, I want to make a computed column, where end_datetime = start_datetime + minute_duration adding an interval to a timestamp.
I keep getting error, how can I fix?
ERROR: generation ...
0
votes
1
answer
48
views
How to deal with null values when using date_part?
I get this error when using date_part
error: function date_part(timestamp without time zone, unknown) does not exist
Sometimes I get a timestamp value, sometimes is null. So how can I handle it with ...
0
votes
2
answers
57
views
Why com.google.code.gson package can not convert value of java.sql.Timestamp correctly from a json string sent from Postman to Tomcat?
What I do?
I sent a GET request from Postman to Tomcat v9.0 with following data.
{
"diaryId":2,
"userId":2,
"createTimestamp":"2022-05-05 12:00:00", ...
0
votes
0
answers
118
views
in MySQL generated columns referring to current_timestamp fail
Given this table structure:
CREATE TABLE t3 (
`id` bigint NOT NULL AUTO_INCREMENT,
`abc` bigint NOT NULL,
`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`createdday` int GENERATED ALWAYS ...
2
votes
1
answer
314
views
Why is java.sql’s Timestamp.of() converting incorrectly from java.time’s LocalDateTime?
I ran into a bug where java.sql's
Timestamp.valueOf(LocalDateTime.MIN())
is converting incorrectly.
Given java.time's
LocalDateTime.MIN() = -999999999-01-01T00:00:00
But when I try to convert it ...
1
vote
1
answer
87
views
Postgres search missing date in hourly sequence
I have a table period_of_hours in PostgreSQL. This table contains several column but for my case is important column timestamp (timestamp without time zone) and key(character varying).
I have a ...
0
votes
1
answer
388
views
How to use mysql's CURRENT_TIMESTAMP from python?
I want to use the MySQLs function CURRENT_TIMESTAMP from python code, but can't figure out how to pass this in my INSERT or UPDATE queries.
try:
mycursor.execute(
"CREATE TABLE IF ...
1
vote
1
answer
249
views
Query DateTime Varchar in Nanoseconds level in Postgres
I have a Postgres table with a column, that has DateTime values as varchar.
date_column
"2023/10/26 17:20:00.100100000"
"2023/10/26 17:20:00.100100000"
To filter this column in ...
0
votes
0
answers
37
views
The display range of TIMESTAMP type in MySQL
In MySQL Docs, the range of TIMESTAMP is from '1970-01-01 00:00:01.000000' UTC to '2038-01-19 03:14:07.499999' UTC.
But this SQL statement can be execute and display correctly:
SELECT TIMESTAMP('1970-...
1
vote
2
answers
7k
views
Is timestamp in postgresql(drizzle-orm) available to store and update to new Date()?
I want to store a latestUpdatedAt variable in my postgresql(drizzle-orm). Here's my schema:
export const documentsTable = pgTable(
"documents",
{
id: serial("id")....
1
vote
3
answers
271
views
SQL to Extract Continuous Timestamp Ranges
Table Device_Status
Id
Status
Timestamp
1
Active
2023-01-13T18.00.01.0187528
2
Active
2023-01-13T18.00.01.0187529
1
Failed
2023-01-13T18.00.01.0187530
3
Active
2023-01-13T18.00.01.0187531
1
Failed
...
0
votes
0
answers
322
views
Timestamp comparison in spark sql
I have below query in spark sql
sparkSession.sql(f"( SELECT * FROM {ordersTable} \
WHERE lastUpdated >= current_timestamp() - INTERVAL 24 hours)")
The date-time in ...
0
votes
1
answer
70
views
Handling Date columns in SQL
I am trying to get some data from a SQL table. After reading the date the output looks like this
ID BEGIN_DT END_DT PX_LAST
---------------------------------------...
0
votes
1
answer
214
views
Unable to produce timestamp with milliseconds using to_timestamp function in spark SQL
I'm trying to convert a string to timestamp using spark SQL in Apache Spark Pool in Azure Synapse with to_timestamp function.
Select to_timestamp('2009-06-12 01:07:22.024', 'yyyy-MM-dd HH:mm:ss.SSS')
...
0
votes
0
answers
16
views
I have to fetch the number of order requests arrived in last 2 hours in a sql server table: ORDER_REQUEST group by order origin id using data_jpa
I have to fetch the number of order requests arrived in last 2 hours in a sql server table: ORDER_REQUEST group by order origin id using data_jpa.
I have tried various ways to achieve this using ...
1
vote
1
answer
160
views
how to add minutes to milliseconds in laravel query, and apply where condition?
I have a table named activities, where waiting_time is in minutes and start_time is in milliseconds.
Name | event_start_waiting_time | event_time |
running| 30 |1685944961000 |...
0
votes
1
answer
954
views
.Net Core 7 with Postgres, Cannot update record with timestamp with time zone as primary key
I have the following situation:
A postgresql 15 database with a table with a `timestamp with time zone' as part of the primary key.
A C# .NET Core 7 application using:
Microsoft.EntityFrameworkCore (...
0
votes
1
answer
494
views
Why doesn't pd.read_sql read timestamps with no DST from my postgresql database?
I am trying to query data from my postgresql database using pd.read_sql. There are timestamptz columns, with a combination of dates which have DST and some which don't. The dates which have a DST ...
0
votes
0
answers
22
views
How to find difference between timestamps in rows that share the same workflow ID?
I have a table that is arranged as such, need to get the average time each step takes, and am using the updated_at column to do so.
workflow_id
step_name
created_at
updated_at
25
data_capture
2022-03-...
0
votes
0
answers
357
views
Unable to filter data with timestamp value using Mybatis and Oracle DB
I have a student_audit table where I am storing some audit information for the student.
The table has existing data.
ID | NAME | AUDIT_TIMESTAMP
___________________________
1 | TEST | 22-JUN-22 07.23....
0
votes
1
answer
118
views
sql query using timestamp returns nothing
I have a SQL table with a column create_date of type timestamp. I want to perform a query on the table that looks like this:
select *
from table
where create_date = '2022-11-17 13:42:42.309'
This ...
0
votes
2
answers
713
views
Timestamp Time is changed after fetching the record
I am facing issue while fetching record, The timestamp value is changed after fetching from DB.
In my Oracle DB the column value is "19-OCT-22 02.15.00.000000000 AM" but after fetching it ...
1
vote
0
answers
139
views
how to check timestamp of the high value for the table partitions in oracle sql
the high value for one of my table partition in oracle sql is TIMESTAMP' 2022-09-06 00:00:00'. My understanding is that it does not represent any timezone. Is there a way for me to check what timezone ...
1
vote
1
answer
733
views
How to Convert Array or String in Snowflake to Timestamp_NTZ
I currently have some incoming datestamps as from outside datasource, but am struggling to define them in a table through my Snowflake Tables.
The column is formatted as such: {"type":"...
0
votes
1
answer
1k
views
Trying to create a TIMESTAMP type, the NOW() function is not working on my Azure DATA studio
CREATE TABLE comments (
content VARCHAR(100),
created_at TIMESTAMP DEFAULT NOW()
);
The error message
'NOW' is not a recognized built-in function name.