Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.db / org.gvsig.fmap.dal.db.mdb / src / test / resources / org / gvsig / fmap / dal / store / mdb / resultSetForSetProvider.sql @ 45692

History | View | Annotate | Download (2.09 KB)

1

    
2
-- ResultSetForSetProvider SQL
3

    
4
-- Simple
5
SELECT 
6
    [ID], [Byte], [Bool1], [Long], [Timestamp], [Date], [Time], 
7
    [Bool2], [String], [Bool3], [Double], [Bool4], [Float], [Bool5], [Decimal], 
8
    [Geometry], [Decimal19_0] 
9
  FROM [test];
10

    
11
-- Simple Group by
12
SELECT 
13
    MIN([test].[ID]) AS [ID], MAX([test].[Byte]) AS [Byte], NULL AS [Bool1], [Long], 
14
    NULL AS [Timestamp], NULL AS [Date], NULL AS [Time], NULL AS [Bool2], 
15
    NULL AS [String], NULL AS [Bool3], SUM([test].[Double]) AS [Double], 
16
    NULL AS [Bool4], NULL AS [Float], NULL AS [Bool5], NULL AS [Decimal], 
17
    NULL AS [Geometry], NULL AS [Decimal19_0] 
18
  FROM [test] 
19
  GROUP BY [test].[Long];
20

    
21
-- Subselect
22
SELECT 
23
    [ID], [Byte], [Bool1], [Long], [Timestamp], [Date], [Time], [Bool2], 
24
    [String], [Bool3], [Double], [Bool4], [Float], [Bool5], [Decimal], 
25
    [Geometry], [Decimal19_0], 
26
    NVL2(COALESCE((
27
      SELECT [ISO_A2] 
28
      FROM [countries] 
29
      WHERE (([TEST].[STRING] = [countries].[CONTINENT]) AND 
30
        ([countries].[LASTCENSUS] < 0)) LIMIT 1)),TRUE,FALSE) 
31
    AS [EXISTS62a964cd7bc24f409b97c03b9170408d] 
32
  FROM [test] 
33
  WHERE NVL2(COALESCE((
34
    SELECT [ISO_A2] 
35
    FROM [countries] 
36
    WHERE (([TEST].[STRING] = [countries].[CONTINENT]) AND 
37
      ([countries].[LASTCENSUS] < 0)) LIMIT 1)),TRUE,FALSE);
38

    
39
-- Group and Subselect
40
SELECT 
41
    MIN([test].[ID]) AS [ID], MAX([test].[Byte]) AS [Byte], NULL AS [Bool1], [Long], 
42
    NULL AS [Timestamp], NULL AS [Date], NULL AS [Time], NULL AS [Bool2], 
43
    NULL AS [String], NULL AS [Bool3], SUM([test].[Double]) AS [Double], 
44
    NULL AS [Bool4], NULL AS [Float], NULL AS [Bool5], NULL AS [Decimal], 
45
    NULL AS [Geometry], NULL AS [Decimal19_0] 
46
  FROM [test] 
47
  WHERE NVL2(COALESCE((
48
    SELECT [ISO_A2] 
49
    FROM [countries] 
50
    WHERE (([TEST].[STRING] = [countries].[CONTINENT]) AND 
51
      ([countries].[LASTCENSUS] < 0)) LIMIT 1)),TRUE,FALSE) 
52
  GROUP BY [test].[Long];
53

    
54
-- Simple
55
SELECT 
56
    [Byte], [Bool1], [Long], [Timestamp], [Date], [Time], 
57
    [Bool2], [String], [Bool3], [Double], [Bool4], [Float], [Bool5], [Decimal], 
58
    [Geometry], [Decimal19_0], [ID] 
59
  FROM [test];