mirror of https://github.com/postgres/postgres
Its starting to actually take shape and look as expected...pull/50/head
parent
588ae64c44
commit
e31cb4be3a
@ -0,0 +1,134 @@ |
||||
QUERY: INSERT INTO tenk2 VALUES (tenk1.*); |
||||
QUERY: SELECT * INTO TABLE onek2 FROM onek; |
||||
QUERY: INSERT INTO fast_emp4000 VALUES (slow_emp4000.*); |
||||
QUERY: SELECT * |
||||
INTO TABLE Bprime |
||||
FROM tenk1 |
||||
WHERE unique2 < 1000; |
||||
QUERY: INSERT INTO hobbies_r (name, person) |
||||
SELECT 'posthacking', p.name |
||||
FROM person* p |
||||
WHERE p.name = 'mike' or p.name = 'jeff'; |
||||
QUERY: INSERT INTO hobbies_r (name, person) |
||||
SELECT 'basketball', p.name |
||||
FROM person p |
||||
WHERE p.name = 'joe' or p.name = 'sally'; |
||||
QUERY: INSERT INTO hobbies_r (name) VALUES ('skywalking'); |
||||
QUERY: INSERT INTO equipment_r (name, hobby) VALUES ('advil', 'posthacking'); |
||||
QUERY: INSERT INTO equipment_r (name, hobby) VALUES ('peet''s coffee', 'posthacking'); |
||||
QUERY: INSERT INTO equipment_r (name, hobby) VALUES ('hightops', 'basketball'); |
||||
QUERY: INSERT INTO equipment_r (name, hobby) VALUES ('guts', 'skywalking'); |
||||
QUERY: SELECT * |
||||
INTO TABLE ramp |
||||
FROM road |
||||
WHERE name ~ '.*Ramp'; |
||||
QUERY: INSERT INTO ihighway |
||||
SELECT * |
||||
FROM road |
||||
WHERE name ~ 'I- .*'; |
||||
QUERY: INSERT INTO shighway |
||||
SELECT * |
||||
FROM road |
||||
WHERE name ~ 'State Hwy.*'; |
||||
QUERY: UPDATE shighway |
||||
SET surface = 'asphalt'; |
||||
QUERY: INSERT INTO a_star (class, a) VALUES ('a', 1); |
||||
QUERY: INSERT INTO a_star (class, a) VALUES ('a', 2); |
||||
QUERY: INSERT INTO a_star (class) VALUES ('a'); |
||||
QUERY: INSERT INTO b_star (class, a, b) VALUES ('b', 3, 'mumble'::text); |
||||
QUERY: INSERT INTO b_star (class, a) VALUES ('b', 4); |
||||
QUERY: INSERT INTO b_star (class, b) VALUES ('b', 'bumble'::text); |
||||
QUERY: INSERT INTO b_star (class) VALUES ('b'); |
||||
QUERY: INSERT INTO c_star (class, a, c) VALUES ('c', 5, 'hi mom'::char16); |
||||
QUERY: INSERT INTO c_star (class, a) VALUES ('c', 6); |
||||
QUERY: INSERT INTO c_star (class, c) VALUES ('c', 'hi paul'::char16); |
||||
QUERY: INSERT INTO c_star (class) VALUES ('c'); |
||||
QUERY: INSERT INTO d_star (class, a, b, c, d) |
||||
VALUES ('d', 7, 'grumble'::text, 'hi sunita'::char16, '0.0'::float8); |
||||
QUERY: INSERT INTO d_star (class, a, b, c) |
||||
VALUES ('d', 8, 'stumble'::text, 'hi koko'::char16); |
||||
QUERY: INSERT INTO d_star (class, a, b, d) |
||||
VALUES ('d', 9, 'rumble'::text, '1.1'::float8); |
||||
QUERY: INSERT INTO d_star (class, a, c, d) |
||||
VALUES ('d', 10, 'hi kristin'::char16, '10.01'::float8); |
||||
QUERY: INSERT INTO d_star (class, b, c, d) |
||||
VALUES ('d', 'crumble'::text, 'hi boris'::char16, '100.001'::float8); |
||||
QUERY: INSERT INTO d_star (class, a, b) |
||||
VALUES ('d', 11, 'fumble'::text); |
||||
QUERY: INSERT INTO d_star (class, a, c) |
||||
VALUES ('d', 12, 'hi avi'::char16); |
||||
QUERY: INSERT INTO d_star (class, a, d) |
||||
VALUES ('d', 13, '1000.0001'::float8); |
||||
QUERY: INSERT INTO d_star (class, b, c) |
||||
VALUES ('d', 'tumble'::text, 'hi andrew'::char16); |
||||
QUERY: INSERT INTO d_star (class, b, d) |
||||
VALUES ('d', 'humble'::text, '10000.00001'::float8); |
||||
QUERY: INSERT INTO d_star (class, c, d) |
||||
VALUES ('d', 'hi ginger'::char16, '100000.000001'::float8); |
||||
QUERY: INSERT INTO d_star (class, a) VALUES ('d', 14); |
||||
QUERY: INSERT INTO d_star (class, b) VALUES ('d', 'jumble'::text); |
||||
QUERY: INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::char16); |
||||
QUERY: INSERT INTO d_star (class, d) VALUES ('d', '1000000.0000001'::float8); |
||||
QUERY: INSERT INTO d_star (class) VALUES ('d'); |
||||
QUERY: INSERT INTO e_star (class, a, c, e) |
||||
VALUES ('e', 15, 'hi carol'::char16, '-1'::int2); |
||||
QUERY: INSERT INTO e_star (class, a, c) |
||||
VALUES ('e', 16, 'hi bob'::char16); |
||||
QUERY: INSERT INTO e_star (class, a, e) |
||||
VALUES ('e', 17, '-2'::int2); |
||||
QUERY: INSERT INTO e_star (class, c, e) |
||||
VALUES ('e', 'hi michelle'::char16, '-3'::int2); |
||||
QUERY: INSERT INTO e_star (class, a) |
||||
VALUES ('e', 18); |
||||
QUERY: INSERT INTO e_star (class, c) |
||||
VALUES ('e', 'hi elisa'::char16); |
||||
QUERY: INSERT INTO e_star (class, e) |
||||
VALUES ('e', '-4'::int2); |
||||
QUERY: INSERT INTO f_star (class, a, c, e, f) |
||||
VALUES ('f', 19, 'hi claire'::char16, '-5'::int2, '(1,2,3,4)'::polygon); |
||||
QUERY: INSERT INTO f_star (class, a, c, e) |
||||
VALUES ('f', 20, 'hi mike'::char16, '-6'::int2); |
||||
QUERY: INSERT INTO f_star (class, a, c, f) |
||||
VALUES ('f', 21, 'hi marcel'::char16, '(11,22,33,44,55,66)'::polygon); |
||||
QUERY: INSERT INTO f_star (class, a, e, f) |
||||
VALUES ('f', 22, '-7'::int2, '(111,222,333,444,555,666,777,888)'::polygon); |
||||
QUERY: INSERT INTO f_star (class, c, e, f) |
||||
VALUES ('f', 'hi keith'::char16, '-8'::int2, |
||||
'(1111,2222,3333,4444)'::polygon); |
||||
QUERY: INSERT INTO f_star (class, a, c) |
||||
VALUES ('f', 24, 'hi marc'::char16); |
||||
QUERY: INSERT INTO f_star (class, a, e) |
||||
VALUES ('f', 25, '-9'::int2); |
||||
QUERY: INSERT INTO f_star (class, a, f) |
||||
VALUES ('f', 26, '(11111,22222,33333,44444)'::polygon); |
||||
QUERY: INSERT INTO f_star (class, c, e) |
||||
VALUES ('f', 'hi allison'::char16, '-10'::int2); |
||||
QUERY: INSERT INTO f_star (class, c, f) |
||||
VALUES ('f', 'hi jeff'::char16, |
||||
'(111111,222222,333333,444444)'::polygon); |
||||
QUERY: INSERT INTO f_star (class, e, f) |
||||
VALUES ('f', '-11'::int2, '(1111111,2222222,3333333,4444444)'::polygon); |
||||
QUERY: INSERT INTO f_star (class, a) VALUES ('f', 27); |
||||
QUERY: INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::char16); |
||||
QUERY: INSERT INTO f_star (class, e) VALUES ('f', '-12'::int2); |
||||
QUERY: INSERT INTO f_star (class, f) |
||||
VALUES ('f', '(11111111,22222222,33333333,44444444)'::polygon); |
||||
QUERY: INSERT INTO f_star (class) VALUES ('f'); |
||||
QUERY: INSERT INTO arrtest (a[5], b[2][1][2], c, d) |
||||
VALUES ('{1,2,3,4,5}', '{{{},{1,2}}}', '{}', '{}'); |
||||
QUERY: UPDATE arrtest SET e[0] = '1.1'; |
||||
QUERY: UPDATE arrtest SET e[1] = '2.2'; |
||||
QUERY: INSERT INTO arrtest (a, b[2][2][1], c, d, e) |
||||
VALUES ('{11,12,23}', '{{3,4},{4,5}}', '{"foobar"}', |
||||
'{{"elt1", "elt2"}}', '{"3.4", "6.7"}'); |
||||
QUERY: INSERT INTO arrtest (a, b[1][2][2], c, d[2][1]) |
||||
VALUES ('{}', '{3,4}', '{foo,bar}', '{bar,foo}'); |
||||
QUERY: CREATE TABLE iportaltest ( |
||||
i int4, |
||||
d float4, |
||||
p polygon |
||||
); |
||||
QUERY: INSERT INTO iportaltest (i, d, p) |
||||
VALUES (1, 3.567, '(3.0,4.0,1.0,2.0)'::polygon); |
||||
QUERY: INSERT INTO iportaltest (i, d, p) |
||||
VALUES (2, 89.05, '(4.0,3.0,2.0,1.0)'::polygon); |
||||
@ -0,0 +1,305 @@ |
||||
=============== running regression queries ... ================= |
||||
QUERY: SELECT onek.* WHERE onek.unique1 < 10; |
||||
unique1|unique2|two|four|ten|twenty|hundred|thousand|twothousand|fivethous|tenthous|odd|even|stringu1|stringu2|string4 |
||||
-------+-------+---+----+---+------+-------+--------+-----------+---------+--------+---+----+--------+--------+------- |
||||
0| 998| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 1|AAAAAA |KMBAAA |OOOOxx |
||||
1| 214| 1| 1| 1| 1| 1| 1| 1| 1| 1| 2| 3|BAAAAA |GIAAAA |OOOOxx |
||||
2| 326| 0| 2| 2| 2| 2| 2| 2| 2| 2| 4| 5|CAAAAA |OMAAAA |OOOOxx |
||||
3| 431| 1| 3| 3| 3| 3| 3| 3| 3| 3| 6| 7|DAAAAA |PQAAAA |VVVVxx |
||||
4| 833| 0| 0| 4| 4| 4| 4| 4| 4| 4| 8| 9|EAAAAA |BGBAAA |HHHHxx |
||||
5| 541| 1| 1| 5| 5| 5| 5| 5| 5| 5| 10| 11|FAAAAA |VUAAAA |HHHHxx |
||||
6| 978| 0| 2| 6| 6| 6| 6| 6| 6| 6| 12| 13|GAAAAA |QLBAAA |OOOOxx |
||||
7| 647| 1| 3| 7| 7| 7| 7| 7| 7| 7| 14| 15|HAAAAA |XYAAAA |VVVVxx |
||||
8| 653| 0| 0| 8| 8| 8| 8| 8| 8| 8| 16| 17|IAAAAA |DZAAAA |HHHHxx |
||||
9| 49| 1| 1| 9| 9| 9| 9| 9| 9| 9| 18| 19|JAAAAA |XBAAAA |HHHHxx |
||||
(10 rows) |
||||
|
||||
QUERY: SELECT onek.unique1, onek.stringu1 |
||||
WHERE onek.unique1 < 20 |
||||
ORDER BY unique1 using >; |
||||
unique1|stringu1 |
||||
-------+-------- |
||||
19|TAAAAA |
||||
18|SAAAAA |
||||
17|RAAAAA |
||||
16|QAAAAA |
||||
15|PAAAAA |
||||
14|OAAAAA |
||||
13|NAAAAA |
||||
12|MAAAAA |
||||
11|LAAAAA |
||||
10|KAAAAA |
||||
9|JAAAAA |
||||
8|IAAAAA |
||||
7|HAAAAA |
||||
6|GAAAAA |
||||
5|FAAAAA |
||||
4|EAAAAA |
||||
3|DAAAAA |
||||
2|CAAAAA |
||||
1|BAAAAA |
||||
0|AAAAAA |
||||
(20 rows) |
||||
|
||||
QUERY: SELECT onek.unique1, onek.stringu1 |
||||
WHERE onek.unique1 > 980 |
||||
ORDER BY stringu1 using <; |
||||
unique1|stringu1 |
||||
-------+-------- |
||||
988|AMAAAA |
||||
989|BMAAAA |
||||
990|CMAAAA |
||||
991|DMAAAA |
||||
992|EMAAAA |
||||
993|FMAAAA |
||||
994|GMAAAA |
||||
995|HMAAAA |
||||
996|IMAAAA |
||||
997|JMAAAA |
||||
998|KMAAAA |
||||
999|LMAAAA |
||||
981|TLAAAA |
||||
982|ULAAAA |
||||
983|VLAAAA |
||||
984|WLAAAA |
||||
985|XLAAAA |
||||
986|YLAAAA |
||||
987|ZLAAAA |
||||
(19 rows) |
||||
|
||||
QUERY: SELECT onek.unique1, onek.string4 |
||||
WHERE onek.unique1 > 980 |
||||
ORDER BY string4 using <, unique1 using >; |
||||
unique1|string4 |
||||
-------+------- |
||||
999|AAAAxx |
||||
995|AAAAxx |
||||
983|AAAAxx |
||||
982|AAAAxx |
||||
981|AAAAxx |
||||
998|HHHHxx |
||||
997|HHHHxx |
||||
993|HHHHxx |
||||
990|HHHHxx |
||||
986|HHHHxx |
||||
996|OOOOxx |
||||
991|OOOOxx |
||||
988|OOOOxx |
||||
987|OOOOxx |
||||
985|OOOOxx |
||||
994|VVVVxx |
||||
992|VVVVxx |
||||
989|VVVVxx |
||||
984|VVVVxx |
||||
(19 rows) |
||||
|
||||
QUERY: SELECT onek.unique1, onek.string4 |
||||
WHERE onek.unique1 > 980 |
||||
ORDER BY string4 using >, unique1 using <; |
||||
unique1|string4 |
||||
-------+------- |
||||
984|VVVVxx |
||||
989|VVVVxx |
||||
992|VVVVxx |
||||
994|VVVVxx |
||||
985|OOOOxx |
||||
987|OOOOxx |
||||
988|OOOOxx |
||||
991|OOOOxx |
||||
996|OOOOxx |
||||
986|HHHHxx |
||||
990|HHHHxx |
||||
993|HHHHxx |
||||
997|HHHHxx |
||||
998|HHHHxx |
||||
981|AAAAxx |
||||
982|AAAAxx |
||||
983|AAAAxx |
||||
995|AAAAxx |
||||
999|AAAAxx |
||||
(19 rows) |
||||
|
||||
QUERY: SELECT onek.unique1, onek.string4 |
||||
WHERE onek.unique1 < 20 |
||||
ORDER BY unique1 using >, string4 using <; |
||||
unique1|string4 |
||||
-------+------- |
||||
19|OOOOxx |
||||
18|VVVVxx |
||||
17|HHHHxx |
||||
16|OOOOxx |
||||
15|VVVVxx |
||||
14|AAAAxx |
||||
13|OOOOxx |
||||
12|AAAAxx |
||||
11|OOOOxx |
||||
10|AAAAxx |
||||
9|HHHHxx |
||||
8|HHHHxx |
||||
7|VVVVxx |
||||
6|OOOOxx |
||||
5|HHHHxx |
||||
4|HHHHxx |
||||
3|VVVVxx |
||||
2|OOOOxx |
||||
1|OOOOxx |
||||
0|OOOOxx |
||||
(20 rows) |
||||
|
||||
QUERY: SELECT onek.unique1, onek.string4 |
||||
WHERE onek.unique1 < 20 |
||||
ORDER BY unique1 using <, string4 using >; |
||||
unique1|string4 |
||||
-------+------- |
||||
0|OOOOxx |
||||
1|OOOOxx |
||||
2|OOOOxx |
||||
3|VVVVxx |
||||
4|HHHHxx |
||||
5|HHHHxx |
||||
6|OOOOxx |
||||
7|VVVVxx |
||||
8|HHHHxx |
||||
9|HHHHxx |
||||
10|AAAAxx |
||||
11|OOOOxx |
||||
12|AAAAxx |
||||
13|OOOOxx |
||||
14|AAAAxx |
||||
15|VVVVxx |
||||
16|OOOOxx |
||||
17|HHHHxx |
||||
18|VVVVxx |
||||
19|OOOOxx |
||||
(20 rows) |
||||
|
||||
QUERY: SELECT two, stringu1, ten, string4 |
||||
INTO TABLE temp |
||||
FROM onek; |
||||
|
||||
QUERY: SELECT p.name, p.age FROM person* p; |
||||
name |age |
||||
-------+--- |
||||
mike | 40 |
||||
joe | 20 |
||||
sally | 34 |
||||
sandra | 19 |
||||
alex | 30 |
||||
sue | 50 |
||||
denise | 24 |
||||
sarah | 88 |
||||
teresa | 38 |
||||
nan | 28 |
||||
leah | 68 |
||||
wendy | 78 |
||||
melissa| 28 |
||||
joan | 18 |
||||
mary | 8 |
||||
jane | 58 |
||||
liza | 38 |
||||
jean | 28 |
||||
jenifer| 38 |
||||
juanita| 58 |
||||
susan | 78 |
||||
zena | 98 |
||||
martie | 88 |
||||
chris | 78 |
||||
pat | 18 |
||||
zola | 58 |
||||
louise | 98 |
||||
edna | 18 |
||||
bertha | 88 |
||||
sumi | 38 |
||||
koko | 88 |
||||
gina | 18 |
||||
rean | 48 |
||||
sharon | 78 |
||||
paula | 68 |
||||
julie | 68 |
||||
belinda| 38 |
||||
karen | 48 |
||||
carina | 58 |
||||
diane | 18 |
||||
esther | 98 |
||||
trudy | 88 |
||||
fanny | 8 |
||||
carmen | 78 |
||||
lita | 25 |
||||
pamela | 48 |
||||
sandy | 38 |
||||
trisha | 88 |
||||
vera | 78 |
||||
velma | 68 |
||||
sharon | 25 |
||||
sam | 30 |
||||
bill | 20 |
||||
fred | 28 |
||||
larry | 60 |
||||
jeff | 23 |
||||
cim | 30 |
||||
linda | 19 |
||||
(58 rows) |
||||
|
||||
QUERY: SELECT p.name, p.age FROM person* p ORDER BY age using >; |
||||
name |age |
||||
-------+--- |
||||
esther | 98 |
||||
louise | 98 |
||||
zena | 98 |
||||
martie | 88 |
||||
bertha | 88 |
||||
trisha | 88 |
||||
koko | 88 |
||||
sarah | 88 |
||||
trudy | 88 |
||||
vera | 78 |
||||
carmen | 78 |
||||
chris | 78 |
||||
sharon | 78 |
||||
susan | 78 |
||||
wendy | 78 |
||||
velma | 68 |
||||
leah | 68 |
||||
julie | 68 |
||||
paula | 68 |
||||
larry | 60 |
||||
carina | 58 |
||||
juanita| 58 |
||||
jane | 58 |
||||
zola | 58 |
||||
sue | 50 |
||||
karen | 48 |
||||
rean | 48 |
||||
pamela | 48 |
||||
mike | 40 |
||||
jenifer| 38 |
||||
sandy | 38 |
||||
teresa | 38 |
||||
liza | 38 |
||||
belinda| 38 |
||||
sumi | 38 |
||||
sally | 34 |
||||
alex | 30 |
||||
cim | 30 |
||||
sam | 30 |
||||
fred | 28 |
||||
nan | 28 |
||||
jean | 28 |
||||
melissa| 28 |
||||
sharon | 25 |
||||
lita | 25 |
||||
denise | 24 |
||||
jeff | 23 |
||||
joe | 20 |
||||
bill | 20 |
||||
linda | 19 |
||||
sandra | 19 |
||||
diane | 18 |
||||
edna | 18 |
||||
gina | 18 |
||||
joan | 18 |
||||
pat | 18 |
||||
fanny | 8 |
||||
mary | 8 |
||||
(58 rows) |
||||
|
||||
@ -0,0 +1,103 @@ |
||||
QUERY: SELECT DISTINCT two FROM temp; |
||||
two |
||||
--- |
||||
0 |
||||
1 |
||||
(2 rows) |
||||
|
||||
QUERY: SELECT DISTINCT ten FROM temp; |
||||
ten |
||||
--- |
||||
0 |
||||
1 |
||||
2 |
||||
3 |
||||
4 |
||||
5 |
||||
6 |
||||
7 |
||||
8 |
||||
9 |
||||
(10 rows) |
||||
|
||||
QUERY: SELECT DISTINCT string4 FROM temp; |
||||
string4 |
||||
------- |
||||
AAAAxx |
||||
HHHHxx |
||||
OOOOxx |
||||
VVVVxx |
||||
(4 rows) |
||||
|
||||
QUERY: SELECT DISTINCT two, string4, ten |
||||
FROM temp |
||||
ORDER BY two using <, string4 using <, ten using <; |
||||
two|string4|ten |
||||
---+-------+--- |
||||
0|AAAAxx | 0 |
||||
0|AAAAxx | 2 |
||||
0|AAAAxx | 4 |
||||
0|AAAAxx | 6 |
||||
0|AAAAxx | 8 |
||||
0|HHHHxx | 0 |
||||
0|HHHHxx | 2 |
||||
0|HHHHxx | 4 |
||||
0|HHHHxx | 6 |
||||
0|HHHHxx | 8 |
||||
0|OOOOxx | 0 |
||||
0|OOOOxx | 2 |
||||
0|OOOOxx | 4 |
||||
0|OOOOxx | 6 |
||||
0|OOOOxx | 8 |
||||
0|VVVVxx | 0 |
||||
0|VVVVxx | 2 |
||||
0|VVVVxx | 4 |
||||
0|VVVVxx | 6 |
||||
0|VVVVxx | 8 |
||||
1|AAAAxx | 1 |
||||
1|AAAAxx | 3 |
||||
1|AAAAxx | 5 |
||||
1|AAAAxx | 7 |
||||
1|AAAAxx | 9 |
||||
1|HHHHxx | 1 |
||||
1|HHHHxx | 3 |
||||
1|HHHHxx | 5 |
||||
1|HHHHxx | 7 |
||||
1|HHHHxx | 9 |
||||
1|OOOOxx | 1 |
||||
1|OOOOxx | 3 |
||||
1|OOOOxx | 5 |
||||
1|OOOOxx | 7 |
||||
1|OOOOxx | 9 |
||||
1|VVVVxx | 1 |
||||
1|VVVVxx | 3 |
||||
1|VVVVxx | 5 |
||||
1|VVVVxx | 7 |
||||
1|VVVVxx | 9 |
||||
(40 rows) |
||||
|
||||
QUERY: SELECT DISTINCT p.age FROM person* p ORDER BY age using >; |
||||
age |
||||
--- |
||||
98 |
||||
88 |
||||
78 |
||||
68 |
||||
60 |
||||
58 |
||||
50 |
||||
48 |
||||
40 |
||||
38 |
||||
34 |
||||
30 |
||||
28 |
||||
25 |
||||
24 |
||||
23 |
||||
20 |
||||
19 |
||||
18 |
||||
8 |
||||
(20 rows) |
||||
|
||||
@ -0,0 +1,15 @@ |
||||
QUERY: SELECT DISTINCT ON string4 two, string4, ten |
||||
FROM temp |
||||
ORDER BY two using <, string4 using <, ten using <; |
||||
two|string4|ten |
||||
---+-------+--- |
||||
0|AAAAxx | 0 |
||||
0|HHHHxx | 0 |
||||
0|OOOOxx | 0 |
||||
0|VVVVxx | 0 |
||||
1|AAAAxx | 1 |
||||
1|HHHHxx | 1 |
||||
1|OOOOxx | 1 |
||||
1|VVVVxx | 1 |
||||
(8 rows) |
||||
|
||||
@ -0,0 +1,10 @@ |
||||
QUERY: SELECT * |
||||
INTO TABLE temp1 |
||||
FROM temp |
||||
WHERE onek.unique1 < 2; |
||||
QUERY: DROP TABLE temp1; |
||||
QUERY: SELECT * |
||||
INTO TABLE temp1 |
||||
FROM temp |
||||
WHERE onek2.unique1 < 2; |
||||
QUERY: DROP TABLE temp1; |
||||
@ -0,0 +1,48 @@ |
||||
-- |
||||
-- create.source |
||||
-- |
||||
-- |
||||
|
||||
-- CLASS POPULATION |
||||
-- (any resemblance to real life is purely coincidental) |
||||
-- |
||||
COPY onek FROM '_CWD_/data/onek.data'; |
||||
|
||||
COPY tenk1 FROM '_CWD_/data/tenk.data'; |
||||
|
||||
COPY slow_emp4000 FROM '_CWD_/data/rect.data'; |
||||
|
||||
COPY person FROM '_CWD_/data/person.data'; |
||||
|
||||
COPY emp FROM '_CWD_/data/emp.data'; |
||||
|
||||
COPY student FROM '_CWD_/data/student.data'; |
||||
|
||||
COPY stud_emp FROM '_CWD_/data/stud_emp.data'; |
||||
|
||||
COPY road FROM '_CWD_/data/streets.data'; |
||||
|
||||
COPY real_city FROM '_CWD_/data/real_city.data'; |
||||
|
||||
COPY hash_i4_heap FROM '_CWD_/data/hash.data'; |
||||
|
||||
COPY hash_c16_heap FROM '_CWD_/data/hash.data'; |
||||
|
||||
COPY hash_txt_heap FROM '_CWD_/data/hash.data'; |
||||
|
||||
COPY hash_f8_heap FROM '_CWD_/data/hash.data'; |
||||
|
||||
-- the data in this file has a lot of duplicates in the index key |
||||
-- fields, leading to long bucket chains and lots of table expansion. |
||||
-- this is therefore a stress test of the bucket overflow code (unlike |
||||
-- the data in hash.data, which has unique index keys). |
||||
-- |
||||
-- COPY hash_ovfl_heap FROM '_CWD_/data/hashovfl.data'; |
||||
|
||||
COPY bt_i4_heap FROM '_CWD_/data/desc.data'; |
||||
|
||||
COPY bt_c16_heap FROM '_CWD_/data/hash.data'; |
||||
|
||||
COPY bt_txt_heap FROM '_CWD_/data/desc.data'; |
||||
|
||||
COPY bt_f8_heap FROM '_CWD_/data/hash.data'; |
||||
@ -0,0 +1,15 @@ |
||||
-- |
||||
-- create.source |
||||
-- |
||||
-- |
||||
|
||||
CREATE FUNCTION circle_in(opaque) |
||||
RETURNS circle |
||||
AS '_OBJWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
|
||||
CREATE FUNCTION circle_out(opaque) |
||||
RETURNS opaque |
||||
AS '_OBJWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
|
||||
@ -0,0 +1,59 @@ |
||||
-- |
||||
-- FUNCTION DEFINITIONS |
||||
-- |
||||
CREATE FUNCTION hobbies(person) |
||||
RETURNS setof hobbies_r |
||||
AS 'select * from hobbies_r where person = $1.name' |
||||
LANGUAGE 'sql'; |
||||
|
||||
|
||||
CREATE FUNCTION hobby_construct(text, text) |
||||
RETURNS hobbies_r |
||||
AS 'select $1 as name, $2 as hobby' |
||||
LANGUAGE 'sql'; |
||||
|
||||
|
||||
CREATE FUNCTION equipment(hobbies_r) |
||||
RETURNS setof equipment_r |
||||
AS 'select * from equipment_r where hobby = $1.name' |
||||
LANGUAGE 'sql'; |
||||
|
||||
|
||||
CREATE FUNCTION user_relns() |
||||
RETURNS setof name |
||||
AS 'select relname |
||||
from pg_class |
||||
where relname !~ ''pg_.*'' and |
||||
relkind <> ''i'' ' |
||||
LANGUAGE 'sql'; |
||||
|
||||
CREATE FUNCTION pt_in_circle(point, circle) |
||||
RETURNS int4 |
||||
AS '_OBJWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
|
||||
CREATE FUNCTION overpaid(emp) |
||||
RETURNS bool |
||||
AS '_OBJWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
|
||||
CREATE FUNCTION boxarea(box) |
||||
RETURNS int4 |
||||
AS '_OBJWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
|
||||
CREATE FUNCTION interpt_pp(path, path) |
||||
RETURNS point |
||||
AS '_OBJWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
|
||||
CREATE FUNCTION reverse_c16(char16) |
||||
RETURNS char16 |
||||
AS '_OBJWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
|
||||
-- |
||||
-- FUNCTION DYNAMIC LOADING |
||||
-- |
||||
LOAD '_OBJWD_/regress_DLSUFFIX_'; |
||||
|
||||
@ -0,0 +1,17 @@ |
||||
QUERY: COPY onek FROM '_CWD_/data/onek.data'; |
||||
QUERY: COPY tenk1 FROM '_CWD_/data/tenk.data'; |
||||
QUERY: COPY slow_emp4000 FROM '_CWD_/data/rect.data'; |
||||
QUERY: COPY person FROM '_CWD_/data/person.data'; |
||||
QUERY: COPY emp FROM '_CWD_/data/emp.data'; |
||||
QUERY: COPY student FROM '_CWD_/data/student.data'; |
||||
QUERY: COPY stud_emp FROM '_CWD_/data/stud_emp.data'; |
||||
QUERY: COPY road FROM '_CWD_/data/streets.data'; |
||||
QUERY: COPY real_city FROM '_CWD_/data/real_city.data'; |
||||
QUERY: COPY hash_i4_heap FROM '_CWD_/data/hash.data'; |
||||
QUERY: COPY hash_c16_heap FROM '_CWD_/data/hash.data'; |
||||
QUERY: COPY hash_txt_heap FROM '_CWD_/data/hash.data'; |
||||
QUERY: COPY hash_f8_heap FROM '_CWD_/data/hash.data'; |
||||
QUERY: COPY bt_i4_heap FROM '_CWD_/data/desc.data'; |
||||
QUERY: COPY bt_c16_heap FROM '_CWD_/data/hash.data'; |
||||
QUERY: COPY bt_txt_heap FROM '_CWD_/data/desc.data'; |
||||
QUERY: COPY bt_f8_heap FROM '_CWD_/data/hash.data'; |
||||
@ -0,0 +1,9 @@ |
||||
QUERY: CREATE FUNCTION circle_in(opaque) |
||||
RETURNS circle |
||||
AS '_CWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
NOTICE:ProcedureCreate: type 'circle' is not yet defined |
||||
QUERY: CREATE FUNCTION circle_out(opaque) |
||||
RETURNS opaque |
||||
AS '_CWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
@ -0,0 +1,40 @@ |
||||
QUERY: CREATE FUNCTION hobbies(person) |
||||
RETURNS setof hobbies_r |
||||
AS 'select * from hobbies_r where person = $1.name' |
||||
LANGUAGE 'sql'; |
||||
QUERY: CREATE FUNCTION hobby_construct(text, text) |
||||
RETURNS hobbies_r |
||||
AS 'select $1 as name, $2 as hobby' |
||||
LANGUAGE 'sql'; |
||||
QUERY: CREATE FUNCTION equipment(hobbies_r) |
||||
RETURNS setof equipment_r |
||||
AS 'select * from equipment_r where hobby = $1.name' |
||||
LANGUAGE 'sql'; |
||||
QUERY: CREATE FUNCTION user_relns() |
||||
RETURNS setof name |
||||
AS 'select relname |
||||
from pg_class |
||||
where relname !~ ''pg_.*'' and |
||||
relkind <> ''i'' ' |
||||
LANGUAGE 'sql'; |
||||
QUERY: CREATE FUNCTION pt_in_circle(point, circle) |
||||
RETURNS int4 |
||||
AS '_CWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
QUERY: CREATE FUNCTION overpaid(emp) |
||||
RETURNS bool |
||||
AS '_CWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
QUERY: CREATE FUNCTION boxarea(box) |
||||
RETURNS int4 |
||||
AS '_CWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
QUERY: CREATE FUNCTION interpt_pp(path, path) |
||||
RETURNS point |
||||
AS '_CWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
QUERY: CREATE FUNCTION reverse_c16(char16) |
||||
RETURNS char16 |
||||
AS '_CWD_/regress_DLSUFFIX_' |
||||
LANGUAGE 'c'; |
||||
QUERY: LOAD '_CWD_/regress_DLSUFFIX_'; |
||||
@ -0,0 +1,230 @@ |
||||
-- |
||||
-- create.source |
||||
-- |
||||
-- |
||||
|
||||
-- CLASS POPULATION |
||||
-- (any resemblance to real life is purely coincidental) |
||||
-- |
||||
|
||||
INSERT INTO tenk2 VALUES (tenk1.*); |
||||
|
||||
SELECT * INTO TABLE onek2 FROM onek; |
||||
|
||||
|
||||
INSERT INTO fast_emp4000 VALUES (slow_emp4000.*); |
||||
|
||||
SELECT * |
||||
INTO TABLE Bprime |
||||
FROM tenk1 |
||||
WHERE unique2 < 1000; |
||||
|
||||
INSERT INTO hobbies_r (name, person) |
||||
SELECT 'posthacking', p.name |
||||
FROM person* p |
||||
WHERE p.name = 'mike' or p.name = 'jeff'; |
||||
|
||||
INSERT INTO hobbies_r (name, person) |
||||
SELECT 'basketball', p.name |
||||
FROM person p |
||||
WHERE p.name = 'joe' or p.name = 'sally'; |
||||
|
||||
INSERT INTO hobbies_r (name) VALUES ('skywalking'); |
||||
|
||||
INSERT INTO equipment_r (name, hobby) VALUES ('advil', 'posthacking'); |
||||
|
||||
INSERT INTO equipment_r (name, hobby) VALUES ('peet''s coffee', 'posthacking'); |
||||
|
||||
INSERT INTO equipment_r (name, hobby) VALUES ('hightops', 'basketball'); |
||||
|
||||
INSERT INTO equipment_r (name, hobby) VALUES ('guts', 'skywalking'); |
||||
|
||||
SELECT * |
||||
INTO TABLE ramp |
||||
FROM road |
||||
WHERE name ~ '.*Ramp'; |
||||
|
||||
INSERT INTO ihighway |
||||
SELECT * |
||||
FROM road |
||||
WHERE name ~ 'I- .*'; |
||||
|
||||
INSERT INTO shighway |
||||
SELECT * |
||||
FROM road |
||||
WHERE name ~ 'State Hwy.*'; |
||||
|
||||
UPDATE shighway |
||||
SET surface = 'asphalt'; |
||||
|
||||
INSERT INTO a_star (class, a) VALUES ('a', 1); |
||||
|
||||
INSERT INTO a_star (class, a) VALUES ('a', 2); |
||||
|
||||
INSERT INTO a_star (class) VALUES ('a'); |
||||
|
||||
INSERT INTO b_star (class, a, b) VALUES ('b', 3, 'mumble'::text); |
||||
|
||||
INSERT INTO b_star (class, a) VALUES ('b', 4); |
||||
|
||||
INSERT INTO b_star (class, b) VALUES ('b', 'bumble'::text); |
||||
|
||||
INSERT INTO b_star (class) VALUES ('b'); |
||||
|
||||
INSERT INTO c_star (class, a, c) VALUES ('c', 5, 'hi mom'::char16); |
||||
|
||||
INSERT INTO c_star (class, a) VALUES ('c', 6); |
||||
|
||||
INSERT INTO c_star (class, c) VALUES ('c', 'hi paul'::char16); |
||||
|
||||
INSERT INTO c_star (class) VALUES ('c'); |
||||
|
||||
INSERT INTO d_star (class, a, b, c, d) |
||||
VALUES ('d', 7, 'grumble'::text, 'hi sunita'::char16, '0.0'::float8); |
||||
|
||||
INSERT INTO d_star (class, a, b, c) |
||||
VALUES ('d', 8, 'stumble'::text, 'hi koko'::char16); |
||||
|
||||
INSERT INTO d_star (class, a, b, d) |
||||
VALUES ('d', 9, 'rumble'::text, '1.1'::float8); |
||||
|
||||
INSERT INTO d_star (class, a, c, d) |
||||
VALUES ('d', 10, 'hi kristin'::char16, '10.01'::float8); |
||||
|
||||
INSERT INTO d_star (class, b, c, d) |
||||
VALUES ('d', 'crumble'::text, 'hi boris'::char16, '100.001'::float8); |
||||
|
||||
INSERT INTO d_star (class, a, b) |
||||
VALUES ('d', 11, 'fumble'::text); |
||||
|
||||
INSERT INTO d_star (class, a, c) |
||||
VALUES ('d', 12, 'hi avi'::char16); |
||||
|
||||
INSERT INTO d_star (class, a, d) |
||||
VALUES ('d', 13, '1000.0001'::float8); |
||||
|
||||
INSERT INTO d_star (class, b, c) |
||||
VALUES ('d', 'tumble'::text, 'hi andrew'::char16); |
||||
|
||||
INSERT INTO d_star (class, b, d) |
||||
VALUES ('d', 'humble'::text, '10000.00001'::float8); |
||||
|
||||
INSERT INTO d_star (class, c, d) |
||||
VALUES ('d', 'hi ginger'::char16, '100000.000001'::float8); |
||||
|
||||
INSERT INTO d_star (class, a) VALUES ('d', 14); |
||||
|
||||
INSERT INTO d_star (class, b) VALUES ('d', 'jumble'::text); |
||||
|
||||
INSERT INTO d_star (class, c) VALUES ('d', 'hi jolly'::char16); |
||||
|
||||
INSERT INTO d_star (class, d) VALUES ('d', '1000000.0000001'::float8); |
||||
|
||||
INSERT INTO d_star (class) VALUES ('d'); |
||||
|
||||
INSERT INTO e_star (class, a, c, e) |
||||
VALUES ('e', 15, 'hi carol'::char16, '-1'::int2); |
||||
|
||||
INSERT INTO e_star (class, a, c) |
||||
VALUES ('e', 16, 'hi bob'::char16); |
||||
|
||||
INSERT INTO e_star (class, a, e) |
||||
VALUES ('e', 17, '-2'::int2); |
||||
|
||||
INSERT INTO e_star (class, c, e) |
||||
VALUES ('e', 'hi michelle'::char16, '-3'::int2); |
||||
|
||||
INSERT INTO e_star (class, a) |
||||
VALUES ('e', 18); |
||||
|
||||
INSERT INTO e_star (class, c) |
||||
VALUES ('e', 'hi elisa'::char16); |
||||
|
||||
INSERT INTO e_star (class, e) |
||||
VALUES ('e', '-4'::int2); |
||||
|
||||
INSERT INTO f_star (class, a, c, e, f) |
||||
VALUES ('f', 19, 'hi claire'::char16, '-5'::int2, '(1,2,3,4)'::polygon); |
||||
|
||||
INSERT INTO f_star (class, a, c, e) |
||||
VALUES ('f', 20, 'hi mike'::char16, '-6'::int2); |
||||
|
||||
INSERT INTO f_star (class, a, c, f) |
||||
VALUES ('f', 21, 'hi marcel'::char16, '(11,22,33,44,55,66)'::polygon); |
||||
|
||||
INSERT INTO f_star (class, a, e, f) |
||||
VALUES ('f', 22, '-7'::int2, '(111,222,333,444,555,666,777,888)'::polygon); |
||||
|
||||
INSERT INTO f_star (class, c, e, f) |
||||
VALUES ('f', 'hi keith'::char16, '-8'::int2, |
||||
'(1111,2222,3333,4444)'::polygon); |
||||
|
||||
INSERT INTO f_star (class, a, c) |
||||
VALUES ('f', 24, 'hi marc'::char16); |
||||
|
||||
INSERT INTO f_star (class, a, e) |
||||
VALUES ('f', 25, '-9'::int2); |
||||
|
||||
INSERT INTO f_star (class, a, f) |
||||
VALUES ('f', 26, '(11111,22222,33333,44444)'::polygon); |
||||
|
||||
INSERT INTO f_star (class, c, e) |
||||
VALUES ('f', 'hi allison'::char16, '-10'::int2); |
||||
|
||||
INSERT INTO f_star (class, c, f) |
||||
VALUES ('f', 'hi jeff'::char16, |
||||
'(111111,222222,333333,444444)'::polygon); |
||||
|
||||
INSERT INTO f_star (class, e, f) |
||||
VALUES ('f', '-11'::int2, '(1111111,2222222,3333333,4444444)'::polygon); |
||||
|
||||
INSERT INTO f_star (class, a) VALUES ('f', 27); |
||||
|
||||
INSERT INTO f_star (class, c) VALUES ('f', 'hi carl'::char16); |
||||
|
||||
INSERT INTO f_star (class, e) VALUES ('f', '-12'::int2); |
||||
|
||||
INSERT INTO f_star (class, f) |
||||
VALUES ('f', '(11111111,22222222,33333333,44444444)'::polygon); |
||||
|
||||
INSERT INTO f_star (class) VALUES ('f'); |
||||
|
||||
-- |
||||
-- ARRAYS |
||||
-- |
||||
|
||||
-- |
||||
-- only this array as a 0-based 'e', the others are 1-based. |
||||
-- 'e' is also a large object. |
||||
-- |
||||
|
||||
INSERT INTO arrtest (a[5], b[2][1][2], c, d) |
||||
VALUES ('{1,2,3,4,5}', '{{{},{1,2}}}', '{}', '{}'); |
||||
|
||||
UPDATE arrtest SET e[0] = '1.1'; |
||||
|
||||
UPDATE arrtest SET e[1] = '2.2'; |
||||
|
||||
INSERT INTO arrtest (a, b[2][2][1], c, d, e) |
||||
VALUES ('{11,12,23}', '{{3,4},{4,5}}', '{"foobar"}', |
||||
'{{"elt1", "elt2"}}', '{"3.4", "6.7"}'); |
||||
|
||||
INSERT INTO arrtest (a, b[1][2][2], c, d[2][1]) |
||||
VALUES ('{}', '{3,4}', '{foo,bar}', '{bar,foo}'); |
||||
|
||||
|
||||
-- |
||||
-- for internal portal (cursor) tests |
||||
-- |
||||
CREATE TABLE iportaltest ( |
||||
i int4, |
||||
d float4, |
||||
p polygon |
||||
); |
||||
|
||||
INSERT INTO iportaltest (i, d, p) |
||||
VALUES (1, 3.567, '(3.0,4.0,1.0,2.0)'::polygon); |
||||
|
||||
INSERT INTO iportaltest (i, d, p) |
||||
VALUES (2, 89.05, '(4.0,3.0,2.0,1.0)'::polygon); |
||||
|
||||
@ -0,0 +1,95 @@ |
||||
-- |
||||
-- btree index |
||||
-- awk '{if($1<10){print;}else{next;}}' onek.data | sort +0n -1 |
||||
-- |
||||
SELECT onek.* WHERE onek.unique1 < 10; |
||||
|
||||
-- |
||||
-- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1 |
||||
-- |
||||
SELECT onek.unique1, onek.stringu1 |
||||
WHERE onek.unique1 < 20 |
||||
ORDER BY unique1 using >; |
||||
|
||||
-- |
||||
-- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2 |
||||
-- |
||||
SELECT onek.unique1, onek.stringu1 |
||||
WHERE onek.unique1 > 980 |
||||
ORDER BY stringu1 using <; |
||||
|
||||
-- |
||||
-- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data | |
||||
-- sort +1d -2 +0nr -1 |
||||
-- |
||||
SELECT onek.unique1, onek.string4 |
||||
WHERE onek.unique1 > 980 |
||||
ORDER BY string4 using <, unique1 using >; |
||||
|
||||
-- |
||||
-- awk '{if($1>980){print $1,$16;}else{next;}}' onek.data | |
||||
-- sort +1dr -2 +0n -1 |
||||
-- |
||||
SELECT onek.unique1, onek.string4 |
||||
WHERE onek.unique1 > 980 |
||||
ORDER BY string4 using >, unique1 using <; |
||||
|
||||
-- |
||||
-- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data | |
||||
-- sort +0nr -1 +1d -2 |
||||
-- |
||||
SELECT onek.unique1, onek.string4 |
||||
WHERE onek.unique1 < 20 |
||||
ORDER BY unique1 using >, string4 using <; |
||||
|
||||
-- |
||||
-- awk '{if($1<20){print $1,$16;}else{next;}}' onek.data | |
||||
-- sort +0n -1 +1dr -2 |
||||
-- |
||||
SELECT onek.unique1, onek.string4 |
||||
WHERE onek.unique1 < 20 |
||||
ORDER BY unique1 using <, string4 using >; |
||||
|
||||
-- |
||||
-- partial btree index |
||||
-- awk '{if($1<10){print $0;}else{next;}}' onek.data | sort +0n -1 |
||||
-- |
||||
--SELECT onek2.* WHERE onek2.unique1 < 10; |
||||
|
||||
-- |
||||
-- partial btree index |
||||
-- awk '{if($1<20){print $1,$14;}else{next;}}' onek.data | sort +0nr -1 |
||||
-- |
||||
--SELECT onek2.unique1, onek2.stringu1 |
||||
-- WHERE onek2.unique1 < 20 |
||||
-- ORDER BY unique1 using >; |
||||
|
||||
-- |
||||
-- awk '{if($1>980){print $1,$14;}else{next;}}' onek.data | sort +1d -2 |
||||
-- |
||||
--SELECT onek2.unique1, onek2.stringu1 |
||||
-- WHERE onek2.unique1 > 980 |
||||
-- ORDER BY stringu1 using <; |
||||
|
||||
SELECT two, stringu1, ten, string4 |
||||
INTO TABLE temp |
||||
FROM onek; |
||||
|
||||
-- |
||||
-- awk '{print $1,$2;}' person.data | |
||||
-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data | |
||||
-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data | |
||||
-- awk 'BEGIN{FS=" ";}{if(NF!=2){print $4,$5;}else{print;}}' - stud_emp.data |
||||
-- |
||||
-- SELECT name, age FROM person*; ??? check if different |
||||
SELECT p.name, p.age FROM person* p; |
||||
|
||||
-- |
||||
-- awk '{print $1,$2;}' person.data | |
||||
-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - emp.data | |
||||
-- awk '{if(NF!=2){print $3,$2;}else{print;}}' - student.data | |
||||
-- awk 'BEGIN{FS=" ";}{if(NF!=1){print $4,$5;}else{print;}}' - stud_emp.data | |
||||
-- sort +1nr -2 |
||||
-- |
||||
SELECT p.name, p.age FROM person* p ORDER BY age using >; |
||||
|
||||
@ -0,0 +1,33 @@ |
||||
-- |
||||
-- awk '{print $3;}' onek.data | sort -n | uniq |
||||
-- |
||||
SELECT DISTINCT two FROM temp; |
||||
|
||||
-- |
||||
-- awk '{print $5;}' onek.data | sort -n | uniq |
||||
-- |
||||
SELECT DISTINCT ten FROM temp; |
||||
|
||||
-- |
||||
-- awk '{print $16;}' onek.data | sort -d | uniq |
||||
-- |
||||
SELECT DISTINCT string4 FROM temp; |
||||
|
||||
-- |
||||
-- awk '{print $3,$16,$5;}' onek.data | sort -d | uniq | |
||||
-- sort +0n -1 +1d -2 +2n -3 |
||||
-- |
||||
SELECT DISTINCT two, string4, ten |
||||
FROM temp |
||||
ORDER BY two using <, string4 using <, ten using <; |
||||
|
||||
-- |
||||
-- awk '{print $2;}' person.data | |
||||
-- awk '{if(NF!=1){print $2;}else{print;}}' - emp.data | |
||||
-- awk '{if(NF!=1){print $2;}else{print;}}' - student.data | |
||||
-- awk 'BEGIN{FS=" ";}{if(NF!=1){print $5;}else{print;}}' - stud_emp.data | |
||||
-- sort -n -r | uniq |
||||
-- |
||||
SELECT DISTINCT p.age FROM person* p ORDER BY age using >; |
||||
|
||||
|
||||
@ -0,0 +1,8 @@ |
||||
|
||||
-- |
||||
-- test select distinct on |
||||
-- |
||||
SELECT DISTINCT ON string4 two, string4, ten |
||||
FROM temp |
||||
ORDER BY two using <, string4 using <, ten using <; |
||||
|
||||
@ -0,0 +1,14 @@ |
||||
SELECT * |
||||
INTO TABLE temp1 |
||||
FROM temp |
||||
WHERE onek.unique1 < 2; |
||||
|
||||
DROP TABLE temp1; |
||||
|
||||
SELECT * |
||||
INTO TABLE temp1 |
||||
FROM temp |
||||
WHERE onek2.unique1 < 2; |
||||
|
||||
DROP TABLE temp1; |
||||
|
||||
Loading…
Reference in new issue