三个字:强、大、全,强力推荐之 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'); Salin selepas log masuk |
16 10:10 Salin selepas log masuk |
select (timestamp '2005-01-17 10:00' - timestamp '2005-01-01') / 7; Salin selepas log masuk |
2 08:17:08.571429 Salin selepas log masuk |
select (timestamp '2005-01-17 10:00' - timestamp '2005-01-01') day; Salin selepas log masuk |
16 Salin selepas log masuk |
select cast((timestamp '2005-01-17 10:00' - timestamp '2005-01-01') day as integer) / 7; Salin selepas log masuk |
2 Salin selepas log masuk Salin selepas log masuk Salin selepas log masuk |
select floor((timestamp '2005-01-17 10:00' - timestamp '2005-01-01') / interval '7'); Salin selepas log masuk |
2 Salin selepas log masuk Salin selepas log masuk Salin selepas log masuk |
select timestamptz '2009-05-29 15:21:00.456789'; Salin selepas log masuk |
2009-05-2915:21:00.456789-04 Salin selepas log masuk |
select timestamptz '2009-05-28'; Salin selepas log masuk |
2009-05-2800:00:00-04 Salin selepas log masuk |
select timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28'; Salin selepas log masuk |
1 15:21:00.456789 Salin selepas log masuk Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28'); Salin selepas log masuk |
1 15:21:00.456789 Salin selepas log masuk Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28')(3); Salin selepas log masuk |
1 15:21:00.457 Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28')second; Salin selepas log masuk |
141660.456789 Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') year; Salin selepas log masuk |
0 Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2007-01-01') month; Salin selepas log masuk |
28 Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2007-01-01') year; Salin selepas log masuk |
2 Salin selepas log masuk Salin selepas log masuk Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2007-01-01') year to month; Salin selepas log masuk |
2-4 Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') second(3); Salin selepas log masuk |
141660.457 Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') minute(3); Salin selepas log masuk |
2361 Salin selepas log masuk Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') minute; Salin selepas log masuk |
2361 Salin selepas log masuk Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') minute to second(3); Salin selepas log masuk |
2361:00.457 Salin selepas log masuk |
select (timestamptz '2009-05-29 15:21:00.456789'-timestamptz '2009-05-28') minute to second; Salin selepas log masuk |
2361:00.456789 Salin selepas log masuk |