Home Database Mysql Tutorial Vertica用于时间计算的SQL语句大全

Vertica用于时间计算的SQL语句大全

Jun 07, 2016 pm 03:56 PM
sql Encyclopedia time calculate statement

三个字:强、大、全,强力推荐之 SQL语句 查询结果 select (timestamp 2005-01-17 10:00 - timestamp 2005-01-01); 16 10:10 select (timestamp 2005-01-17 10:00 - timestamp 2005-01-01) / 7; 2 08:17:08.571429 select (timestamp 2005-01-17 10:00 - tim

三个字:强、大、全,强力推荐之

SQL语句 查询结果
select (timestamp '2005-01-17 10:00' - timestamp '2005-01-01'); 
Copy after login
16 10:10
Copy after login
select (timestamp '2005-01-17 10:00' - timestamp '2005-01-01') / 7; 
Copy after login
2 08:17:08.571429
Copy after login
select (timestamp '2005-01-17 10:00' - timestamp '2005-01-01') day; 
Copy after login
16
Copy after login
select cast((timestamp '2005-01-17 10:00' - timestamp '2005-01-01') day as integer) / 7; 
Copy after login
2
Copy after login
Copy after login
Copy after login
select floor((timestamp '2005-01-17 10:00' - timestamp '2005-01-01') / interval '7'); 
Copy after login
2
Copy after login
Copy after login
Copy after login
select timestamptz '2009-05-29 15:21:00.456789';
Copy after login
2009-05-2915:21:00.456789-04
Copy after login
select timestamptz '2009-05-28';
Copy after login
2009-05-2800:00:00-04
Copy after login
select timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28';
Copy after login
1 15:21:00.456789
Copy after login
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28');
Copy after login
1 15:21:00.456789
Copy after login
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28')(3);
Copy after login
1 15:21:00.457
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28')second;
Copy after login
141660.456789
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') year;
Copy after login
0
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2007-01-01') month;
Copy after login
28
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2007-01-01') year;
Copy after login
2
Copy after login
Copy after login
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2007-01-01') year to month;
Copy after login
2-4
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') second(3);
Copy after login
141660.457
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') minute(3);
Copy after login
2361
Copy after login
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') minute;
Copy after login
2361
Copy after login
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') minute to second(3);
Copy after login
2361:00.457
Copy after login
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') minute to second;
Copy after login
2361:00.456789
Copy after login

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the difference between HQL and SQL in Hibernate framework? What is the difference between HQL and SQL in Hibernate framework? Apr 17, 2024 pm 02:57 PM

HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

CUDA's universal matrix multiplication: from entry to proficiency! CUDA's universal matrix multiplication: from entry to proficiency! Mar 25, 2024 pm 12:30 PM

General Matrix Multiplication (GEMM) is a vital part of many applications and algorithms, and is also one of the important indicators for evaluating computer hardware performance. In-depth research and optimization of the implementation of GEMM can help us better understand high-performance computing and the relationship between software and hardware systems. In computer science, effective optimization of GEMM can increase computing speed and save resources, which is crucial to improving the overall performance of a computer system. An in-depth understanding of the working principle and optimization method of GEMM will help us better utilize the potential of modern computing hardware and provide more efficient solutions for various complex computing tasks. By optimizing the performance of GEMM

How much does a Douyin level 10 light sign cost? How many days does it take to create a level 10 fan sign? How much does a Douyin level 10 light sign cost? How many days does it take to create a level 10 fan sign? Mar 11, 2024 pm 05:37 PM

On the Douyin platform, many users are eager to obtain level certification, and the level 10 light sign shows the user's influence and recognition on Douyin. This article will delve into the price of Douyin’s level 10 light boards and the time it takes to reach this level to help users better understand the process. 1. How much does a level 10 Douyin light sign cost? The price of Douyin's 10-level light signs will vary depending on market fluctuations and supply and demand. The general price ranges from a few thousand yuan to ten thousand yuan. This price mainly includes the cost of the light sign itself and possible service fees. Users can purchase level 10 light signs through Douyin’s official channels or third-party service agencies, but they should pay attention to legal channels when purchasing to avoid false or fraudulent transactions. 2. How many days does it take to create a level 10 fan sign? Reach level 10 light sign

How to calculate addition, subtraction, multiplication and division in word document How to calculate addition, subtraction, multiplication and division in word document Mar 19, 2024 pm 08:13 PM

WORD is a powerful word processor. We can use word to edit various texts. In Excel tables, we have mastered the calculation methods of addition, subtraction and multipliers. So if we need to calculate the addition of numerical values ​​in Word tables, How to subtract the multiplier? Can I only use a calculator to calculate it? The answer is of course no, WORD can also do it. Today I will teach you how to use formulas to calculate basic operations such as addition, subtraction, multiplication and division in tables in Word documents. Let's learn together. So, today let me demonstrate in detail how to calculate addition, subtraction, multiplication and division in a WORD document? Step 1: Open a WORD, click [Table] under [Insert] on the toolbar, and insert a table in the drop-down menu.

Usage of division operation in Oracle SQL Usage of division operation in Oracle SQL Mar 10, 2024 pm 03:06 PM

"Usage of Division Operation in OracleSQL" In OracleSQL, division operation is one of the common mathematical operations. During data query and processing, division operations can help us calculate the ratio between fields or derive the logical relationship between specific values. This article will introduce the usage of division operation in OracleSQL and provide specific code examples. 1. Two ways of division operations in OracleSQL In OracleSQL, division operations can be performed in two different ways.

Comparison and differences of SQL syntax between Oracle and DB2 Comparison and differences of SQL syntax between Oracle and DB2 Mar 11, 2024 pm 12:09 PM

Oracle and DB2 are two commonly used relational database management systems, each of which has its own unique SQL syntax and characteristics. This article will compare and differ between the SQL syntax of Oracle and DB2, and provide specific code examples. Database connection In Oracle, use the following statement to connect to the database: CONNECTusername/password@database. In DB2, the statement to connect to the database is as follows: CONNECTTOdataba

Detailed explanation of the Set tag function in MyBatis dynamic SQL tags Detailed explanation of the Set tag function in MyBatis dynamic SQL tags Feb 26, 2024 pm 07:48 PM

Interpretation of MyBatis dynamic SQL tags: Detailed explanation of Set tag usage MyBatis is an excellent persistence layer framework. It provides a wealth of dynamic SQL tags and can flexibly construct database operation statements. Among them, the Set tag is used to generate the SET clause in the UPDATE statement, which is very commonly used in update operations. This article will explain in detail the usage of the Set tag in MyBatis and demonstrate its functionality through specific code examples. What is Set tag Set tag is used in MyBati

How long does it take to clear the Elden Ring? How long does it take to clear the Elden Ring? Mar 11, 2024 pm 12:50 PM

Players can experience the main plot of the game and collect game achievements when playing in Elden's Circle. Many players don't know how long it takes to clear Elden's Circle. The player's clearance process is 30 hours. How long does it take to clear the Elden Ring? Answer: 30 hours. 1. Although this 30-hour clearance time does not refer to a master-like speed pass, it also omits a lot of processes. 2. If you want to get a better game experience or experience the complete plot, then you will definitely need to spend more time on the duration. 3. If players collect them all, it will take about 100-120 hours. 4. If you only take the main line to brush BOSS, it will take about 50-60 hours. 5. If you want to experience it all: 150 hours of base time.

See all articles