如何在PostgreSQL中写入40分钟的interval类型值?
How to Input a 40-Minute Interval in PostgreSQL via OmniDB
Hey there! I totally get the confusion with interval formats—PostgreSQL has a few flexible options, so let's break down the easiest ways to input that 40-minute value in OmniDB:
- Human-readable full format: The most straightforward way is to use the explicit unit. Just enter
'40 minutes'(you can also use the abbreviation'40 min'if you prefer). This is super clear and hard to mix up. - Time-style format: If you're used to writing time values, you can input
'00:40:00'—PostgreSQL will interpret this as 0 hours, 40 minutes, and 0 seconds, which maps directly to a 40-minute interval. - Short abbreviation format: For brevity, you can use the single-letter unit code:
'40m'. PostgreSQL recognizesmas minutes here (just make sure you don't mix it up with months in longer interval strings—but for a 40-minute value, it'll be interpreted correctly).
Example Insert Statement
If you're running a raw SQL query in OmniDB's query editor, it would look like this:
INSERT INTO your_table_name (your_interval_column) VALUES ('40 minutes');
For OmniDB's visual data insertion interface (where you fill in fields directly), just type any of the above values into the interval field—most of the time, you don't even need the single quotes, but adding them won't hurt either.
内容的提问来源于stack exchange,提问作者Samuel Mungy
相关产品推荐
相关产品推荐

