Revision 5982
Added by Aaron Marcuse-Kubitza about 12 years ago
verify.plots.sql | ||
---|---|---|
6 | 6 |
; |
7 | 7 |
|
8 | 8 |
SELECT 'projects' AS ___; |
9 |
SELECT projectname AS project
|
|
9 |
SELECT projectname |
|
10 | 10 |
FROM project |
11 | 11 |
WHERE reference_id = |
12 | 12 |
(SELECT reference_id FROM reference WHERE shortname = :datasource) |
13 |
ORDER BY project |
|
13 |
ORDER BY projectname
|
|
14 | 14 |
; |
15 | 15 |
|
16 | 16 |
SELECT E'each project\'s # locations' AS ___; |
17 |
SELECT projectname AS project, count(*) AS locations_count
|
|
17 |
SELECT projectname, count(*) AS locations_count |
|
18 | 18 |
FROM project |
19 | 19 |
JOIN locationevent USING (project_id) |
20 | 20 |
WHERE project.reference_id = |
21 | 21 |
(SELECT reference_id FROM reference WHERE shortname = :datasource) |
22 |
GROUP BY project |
|
23 |
ORDER BY project |
|
22 |
GROUP BY projectname
|
|
23 |
ORDER BY projectname
|
|
24 | 24 |
; |
25 | 25 |
|
26 | 26 |
SELECT '# locations' AS ___; |
... | ... | |
41 | 41 |
|
42 | 42 |
SELECT '1st methods' AS ___; |
43 | 43 |
SELECT DISTINCT |
44 |
projectname AS project
|
|
44 |
projectname |
|
45 | 45 |
, method.name AS method |
46 | 46 |
FROM project |
47 | 47 |
JOIN locationevent USING (project_id) |
48 | 48 |
JOIN method USING (method_id) |
49 | 49 |
WHERE project.reference_id = |
50 | 50 |
(SELECT reference_id FROM reference WHERE shortname = :datasource) |
51 |
ORDER BY project, method |
|
51 |
ORDER BY projectname, method
|
|
52 | 52 |
LIMIT 10; |
53 | 53 |
|
54 | 54 |
SELECT '1st observation measures' AS ___; |
55 | 55 |
SELECT DISTINCT |
56 |
projectname AS project
|
|
56 |
projectname |
|
57 | 57 |
, method.observationmeasure AS observationmeasure |
58 | 58 |
FROM project |
59 | 59 |
JOIN locationevent USING (project_id) |
60 | 60 |
JOIN method USING (method_id) |
61 | 61 |
WHERE project.reference_id = |
62 | 62 |
(SELECT reference_id FROM reference WHERE shortname = :datasource) |
63 |
ORDER BY project, observationmeasure |
|
63 |
ORDER BY projectname, observationmeasure
|
|
64 | 64 |
LIMIT 10; |
Also available in: Unified diff
mappings/verify.plots.sql, inputs/SALVIAS/verify/plots.ref.sql: Renamed project column to projectname to avoid confusion with the project table