Revision 46106 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.h2spatial/org.gvsig.h2spatial.h2gis132/org.gvsig.h2spatial.h2gis132.provider/src/test/resources/org/gvsig/fmap/dal/store/h2/resultSetForSetProvider.sql

View differences:

resultSetForSetProvider.sql
6 6
    "ID", "Byte", "Bool1", "Long", "Timestamp", "Date", "Time", 
7 7
    "Bool2", "String", "Bool3", "Double", "Bool4", "Float", "Bool5", "Decimal", 
8 8
    NVL2("Geometry",ST_AsBinary("Geometry"),NULL) 
9
  FROM "PUBLIC"."test" ORDER BY "ID" ASC;
9
  FROM "PUBLIC"."test" ORDER BY "ID" ASC NULLS LAST;
10 10

  
11 11
-- Simple Group by
12 12
SELECT 
......
16 16
    NULL AS "Bool4", NULL AS "Float", NULL AS "Bool5", NULL AS "Decimal", 
17 17
    NULL AS "Geometry" 
18 18
  FROM "PUBLIC"."test" 
19
  GROUP BY "test"."Long" ORDER BY "test"."Long" ASC, "ID" ASC;
19
  GROUP BY "test"."Long" ORDER BY "test"."Long" ASC NULLS LAST, "ID" ASC NULLS LAST;
20 20

  
21 21
-- Subselect
22 22
SELECT 
......
34 34
    SELECT "ISO_A2" 
35 35
    FROM "countries" 
36 36
    WHERE (("TEST"."STRING" = "countries"."CONTINENT") AND 
37
      ("countries"."LASTCENSUS" < 0)) LIMIT 1)),TRUE,FALSE) ORDER BY "ID" ASC;
37
      ("countries"."LASTCENSUS" < 0)) LIMIT 1)),TRUE,FALSE) ORDER BY "ID" ASC NULLS LAST;
38 38

  
39 39
-- Group and Subselect
40 40
SELECT 
......
49 49
    FROM "countries" 
50 50
    WHERE (("TEST"."STRING" = "countries"."CONTINENT") AND 
51 51
      ("countries"."LASTCENSUS" < 0)) LIMIT 1)),TRUE,FALSE) 
52
  GROUP BY "test"."Long" ORDER BY "test"."Long" ASC, "ID" ASC;
52
  GROUP BY "test"."Long" ORDER BY "test"."Long" ASC NULLS LAST, "ID" ASC NULLS LAST;
53 53

  
54 54
-- Simple
55 55
SELECT 
56 56
    "Byte", "Bool1", "Long", "Timestamp", "Date", "Time", 
57 57
    "Bool2", "String", "Bool3", "Double", "Bool4", "Float", "Bool5", "Decimal", 
58 58
    NVL2("Geometry",ST_AsBinary("Geometry"),NULL), "ID" 
59
  FROM "PUBLIC"."test" ORDER BY "ID" ASC;
59
  FROM "PUBLIC"."test" ORDER BY "ID" ASC NULLS LAST;
60 60

  
61 61
-- Computed Attribute
62 62
SELECT "ID", "Byte", "Bool1", "Long", "Timestamp", "Date", "Time", 
63 63
    "Bool2", "String", "Bool3", "Double", "Bool4", "Float", "Bool5", "Decimal", 
64 64
    NVL2("Geometry",ST_AsBinary("Geometry"),NULL), 
65 65
    ("ID" * 2) AS "Compu1" 
66
FROM "PUBLIC"."test" ORDER BY "ID" ASC;
66
FROM "PUBLIC"."test" ORDER BY "ID" ASC NULLS LAST;
67 67

  
68 68
-- Computed Attribute 2
69 69
SELECT "ID", "Byte", "Bool1", "Long", "Timestamp", "Date", "Time", 
......
71 71
    NVL2("Geometry",ST_AsBinary("Geometry"),NULL), 
72 72
    ("ID" * 2) AS "Compu1", 
73 73
    (("Long" + 10) + ("ID" * 2)) AS "Compu2" 
74
FROM "PUBLIC"."test" ORDER BY "ID" ASC;
74
FROM "PUBLIC"."test" ORDER BY "ID" ASC NULLS LAST;
75 75

  
76 76
-- Computed Extra column 1
77 77
SELECT "ID", "Byte", "Bool1", "Long", "Timestamp", "Date", "Time", 
......
79 79
    NVL2("Geometry",ST_AsBinary("Geometry"),NULL), 
80 80
    ("ID" * 2) AS "Compu1", 
81 81
    (("Long" + 10) + ("ID" * 2)) AS "Extra1" 
82
FROM "PUBLIC"."test" ORDER BY "ID" ASC;
82
FROM "PUBLIC"."test" ORDER BY "ID" ASC NULLS LAST;
83 83

  
84 84
-- Computed Extra column 2
85 85
SELECT "ID", "Byte", "Bool1", "Long", "Timestamp", "Date", "Time", 
......
87 87
    NVL2("Geometry",ST_AsBinary("Geometry"),NULL), 
88 88
    ("ID" * 2) AS "Extra1", 
89 89
    (("Long" + 10) + ("ID" * 2)) AS "Extra2" 
90
FROM "PUBLIC"."test" ORDER BY "ID" ASC;
90
FROM "PUBLIC"."test" ORDER BY "ID" ASC NULLS LAST;
91 91

  
92 92
-- Computed Extra column with where
93 93
SELECT "ID", "Byte", "Bool1", "Long", "Timestamp", "Date", "Time", 
......
95 95
    NVL2("Geometry",ST_AsBinary("Geometry"),NULL), 
96 96
    ("ID" * 2) AS "Compu1", 
97 97
    (("Long" + 10) + ("ID" * 2)) AS "Extra1" 
98
FROM "PUBLIC"."test" WHERE ((("Long" + 10) + (("ID" * 2))) > 10) ORDER BY "Extra1" ASC, "ID" ASC;
98
FROM "PUBLIC"."test" WHERE ((("Long" + 10) + (("ID" * 2))) > 10) ORDER BY "Extra1" ASC NULLS LAST, "ID" ASC NULLS LAST;
99 99

  
100 100
-- Group by with computed columns and aggregate functions
101 101
SELECT MIN("test"."ID") AS "ID", MAX("test"."Byte") AS "Byte", NULL AS "Bool1", "Long", 
......
108 108
    SUM(((20 + "Byte") + ("ID" * 2))) AS "Extra2", 
109 109
    (("Long" + 10) + (("ID" * 2))) AS "Extra1" 
110 110
FROM "PUBLIC"."test" GROUP BY "test"."Long", (("Long" + 10) + (("ID" * 2))), (("ID" * 2)) 
111
ORDER BY "test"."Long" ASC, "Extra1" ASC, "Compu1" ASC, "ID" ASC;
111
ORDER BY "test"."Long" ASC NULLS LAST, "Extra1" ASC NULLS LAST, "Compu1" ASC NULLS LAST, "ID" ASC NULLS LAST;

Also available in: Unified diff