Difference between revisions of "Template:Resultlink"

From Testiwiki
Jump to: navigation, search
m
(Locations added to the sample view)
Line 9: Line 9:
 
AND Run.id = Objinfo.Obj_id  
 
AND Run.id = Objinfo.Obj_id  
 
GROUP BY Var.id, Run.id
 
GROUP BY Var.id, Run.id
 +
ORDER BY Run.id
 
|List of uploads}} |  
 
|List of uploads}} |  
 
[http://base.opasnet.org/index.php?page_id={{PAGEID}}&wiki_id=1&sample={{{1|1}}} The newest upload] |
 
[http://base.opasnet.org/index.php?page_id={{PAGEID}}&wiki_id=1&sample={{{1|1}}} The newest upload] |
Line 27: Line 28:
 
|Cell means and samplesizes (N)}} |  
 
|Cell means and samplesizes (N)}} |  
 
{{#sql-query:
 
{{#sql-query:
SELECT Var.Ident, Cell.id, Cell.Obj_id_r as Run, Obs, Result, Var.Unit  
+
SELECT Temp.*, GROUP_CONCAT(Location SEPARATOR ', ') AS Locations 
FROM Obj as Var, Cell, Res  
+
FROM Loccell, Loc,
WHERE Var.Ident = "Op_en{{PAGEID}}"
+
  (SELECT Var.Ident, Cell.id, Cell.Obj_id_r as Upload, Obs, Result, Var.Unit
AND Var.id = Cell.Obj_id_v  
+
  FROM Obj as Var, Cell, Res
AND Cell.id = Res.Cell_id  
+
  WHERE Var.Ident = "Op_en{{PAGEID}}"
ORDER BY Cell.Obj_id_r, Var.Ident, Cell.id
+
  AND Var.id = Cell.Obj_id_v
 +
  AND Cell.id = Res.Cell_id
 +
  ORDER BY Cell.Obj_id_r, Var.Ident, Cell.id) AS Temp
 +
WHERE Temp.id = Loccell.Cell_id AND Loc.id = Loccell.Loc_id
 +
GROUP BY Temp.id, Obs ORDER BY Upload DESC
 
|Full sample}}
 
|Full sample}}
  

Revision as of 07:23, 22 April 2009

Show results from the Opasnet Base:

{{#sql-query: SELECT Var.Ident, Var.Name, Var.Unit, Run.Ident, Objinfo.Moment, Objinfo.Who, Run.Name as Method FROM Obj as Var, Obj as Run, Cell, Objinfo WHERE Var.Ident = "Op_en2239" AND Var.id = Cell.Obj_id_v AND Run.id = Cell.Obj_id_r AND Run.id = Objinfo.Obj_id GROUP BY Var.id, Run.id ORDER BY Run.id |List of uploads}} | The newest upload | {{#sql-query: SELECT Temp.*, GROUP_CONCAT(Location SEPARATOR ', ') AS Locations FROM Loccell, Loc,

 (SELECT Var.Ident, Var.Name, Cell.id, Run.id as Upload, N, Objinfo.Moment, Mean, Var.Unit  
 FROM Obj as Var, Obj as Run, Cell, Objinfo  
 WHERE Var.Ident = "Op_en2239"  
 AND Var.id = Cell.Obj_id_v  
 AND Run.id = Cell.Obj_id_r  
 AND Run.id = Objinfo.Obj_id  
 GROUP BY Cell.id ORDER BY Run.id DESC, Var.Ident) AS Temp

WHERE Temp.id = Loccell.Cell_id AND Loc.id = Loccell.Loc_id GROUP BY Temp.id ORDER BY Upload DESC |Cell means and samplesizes (N)}} | {{#sql-query: SELECT Temp.*, GROUP_CONCAT(Location SEPARATOR ', ') AS Locations FROM Loccell, Loc,

 (SELECT Var.Ident, Cell.id, Cell.Obj_id_r as Upload, Obs, Result, Var.Unit
 FROM Obj as Var, Cell, Res
 WHERE Var.Ident = "Op_en2239"
 AND Var.id = Cell.Obj_id_v
 AND Cell.id = Res.Cell_id
 ORDER BY Cell.Obj_id_r, Var.Ident, Cell.id) AS Temp 

WHERE Temp.id = Loccell.Cell_id AND Loc.id = Loccell.Loc_id GROUP BY Temp.id, Obs ORDER BY Upload DESC |Full sample}}


USAGE:
This template creates a link to a variable in result database.
First parameter is number of samples.

Development idea: Templaatti avaa tuloksen uuteen ikkunaan. Siellä on linkki, jota klikkaamalla tulee compare versions muuttujan nykyisestä wikisivusta ja siitä, joka oli voimassa sillä hetkellä kun muuttuja laskettiin tulostietokantaan.