Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit89abee4

Browse files
author
Thomas G. Lockhart
committed
Test the "SET DateStyle TO..." date formatting modes.
1 parent45409f0 commit89abee4

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

‎src/test/regress/sql/horology.sql

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,61 @@ SELECT '' AS six, f1 as reltime, timespan( f1) AS timespan
8989

9090
DROPTABLE TEMP_DATETIME;
9191

92+
--
93+
-- formats
94+
--
95+
96+
SET DateStyle TO'US,Postgres';
97+
98+
SHOW DateStyle;
99+
100+
SELECT''AS sixty_two, d1AS us_postgresFROM DATETIME_TBL;
101+
102+
SELECT''AS eight, f1AS us_postgresFROM ABSTIME_TBL;
103+
104+
SET DateStyle TO'US,ISO';
105+
106+
SELECT''AS sixty_two, d1AS us_isoFROM DATETIME_TBL;
107+
108+
SELECT''AS eight, f1AS us_isoFROM ABSTIME_TBL;
109+
110+
SET DateStyle TO'US,SQL';
111+
112+
SHOW DateStyle;
113+
114+
SELECT''AS sixty_two, d1AS us_sqlFROM DATETIME_TBL;
115+
116+
SELECT''AS eight, f1AS us_sqlFROM ABSTIME_TBL;
117+
118+
SET DateStyle TO'European,Postgres';
119+
120+
SHOW DateStyle;
121+
122+
INSERT INTO DATETIME_TBLVALUES('13/06/1957');
123+
124+
SELECTcount(*)as oneFROM DATETIME_TBLWHERE d1='Jun 13 1957';
125+
126+
SELECT''AS sixty_three, d1AS european_postgresFROM DATETIME_TBL;
127+
128+
SELECT''AS eight, f1AS european_postgresFROM ABSTIME_TBL;
129+
130+
SET DateStyle TO'European,ISO';
131+
132+
SHOW DateStyle;
133+
134+
SELECT''AS sixty_three, d1AS european_isoFROM DATETIME_TBL;
135+
136+
SELECT''AS eight, f1AS european_isoFROM ABSTIME_TBL;
137+
138+
SET DateStyle TO'European,SQL';
139+
140+
SHOW DateStyle;
141+
142+
SELECT''AS sixty_three, d1AS european_sqlFROM DATETIME_TBL;
143+
144+
SELECT''AS eight, f1AS european_sqlFROM ABSTIME_TBL;
145+
146+
RESET DateStyle;
147+
148+
SHOW DateStyle;
149+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp