Revision 5982
Added by Aaron Marcuse-Kubitza about 12 years ago
plots.ref.sql | ||
---|---|---|
2 | 2 |
SELECT count(*) AS count FROM projects; |
3 | 3 |
|
4 | 4 |
SELECT 'projects' AS ___; |
5 |
SELECT CAST(project_name AS text) AS project FROM projects ORDER BY project;
|
|
5 |
SELECT CAST(project_name AS text) AS projectname FROM projects ORDER BY projectname;
|
|
6 | 6 |
|
7 | 7 |
SELECT 'each project''s # locations' AS ___; |
8 | 8 |
SELECT |
9 |
CAST(project_name AS text) AS project |
|
9 |
CAST(project_name AS text) AS projectname
|
|
10 | 10 |
, count("PlotID") AS locations_count |
11 | 11 |
FROM projects |
12 | 12 |
JOIN "plotMetadata" ON "plotMetadata".project_id = projects.project_id |
13 |
GROUP BY project |
|
14 |
ORDER BY project |
|
13 |
GROUP BY projectname
|
|
14 |
ORDER BY projectname
|
|
15 | 15 |
; |
16 | 16 |
|
17 | 17 |
SELECT '# locations' AS ___; |
... | ... | |
23 | 23 |
|
24 | 24 |
SELECT '1st methods' AS ___; |
25 | 25 |
SELECT DISTINCT |
26 |
CAST(project_name AS text) AS project |
|
26 |
CAST(project_name AS text) AS projectname
|
|
27 | 27 |
, "PlotMethod" AS method |
28 | 28 |
FROM projects |
29 | 29 |
JOIN "plotMetadata" ON "plotMetadata".project_id = projects.project_id |
30 |
ORDER BY project, method |
|
30 |
ORDER BY projectname, method
|
|
31 | 31 |
LIMIT 10; |
32 | 32 |
|
33 | 33 |
SELECT '1st observation measures' AS ___; |
34 | 34 |
SELECT DISTINCT |
35 |
CAST(project_name AS text) AS project |
|
35 |
CAST(project_name AS text) AS projectname
|
|
36 | 36 |
, "lookup_MethodCode"."Description" AS observationmeasure |
37 | 37 |
FROM projects |
38 | 38 |
JOIN "plotMetadata" ON "plotMetadata".project_id = projects.project_id |
39 | 39 |
JOIN "lookup_MethodCode" ON "lookup_MethodCode"."MethodCode" = "plotMetadata"."MethodCode" |
40 |
ORDER BY project, observationmeasure |
|
40 |
ORDER BY projectname, observationmeasure
|
|
41 | 41 |
LIMIT 10; |
42 | 42 |
|
43 | 43 |
/* |
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