<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.heurekaslu.se/w/index.php?action=history&amp;feed=atom&amp;title=SQL_Queries</id>
	<title>SQL Queries - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.heurekaslu.se/w/index.php?action=history&amp;feed=atom&amp;title=SQL_Queries"/>
	<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=SQL_Queries&amp;action=history"/>
	<updated>2026-10-27T22:08:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://www.heurekaslu.se/w/index.php?title=SQL_Queries&amp;diff=8224&amp;oldid=prev</id>
		<title>Peder at 18:16, 7 March 2016</title>
		<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=SQL_Queries&amp;diff=8224&amp;oldid=prev"/>
		<updated>2016-03-07T18:16:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:16, 7 March 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Reference Manual]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you are interested in results that you for some reason cannot obtain with the tools available in the applications, you can always run queries in SQL Server Management Studio. The results consists of several tables that must be joined. Below is one example of a query that creates a list of stand-level treatments for a selected optimization. To run this script, open SQL Server Management Studio, connect to the database server, and right-click &amp;quot;My_Heureka_Results&amp;quot; (or corresponding). Choose &amp;quot;New Query&amp;quot;, paste the script below and click on &amp;quot;Execute&amp;quot;. To see what value to use in the condition for &amp;quot;OPTIMIZATION.OptimizationNo&amp;quot; and &amp;quot;SIMULATION.SimNo&amp;quot;, open the tables dbo.Optimization and dbo.Simulation, respectively, and look for the correct result sets.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you are interested in results that you for some reason cannot obtain with the tools available in the applications, you can always run queries in SQL Server Management Studio. The results consists of several tables that must be joined. Below is one example of a query that creates a list of stand-level treatments for a selected optimization. To run this script, open SQL Server Management Studio, connect to the database server, and right-click &amp;quot;My_Heureka_Results&amp;quot; (or corresponding). Choose &amp;quot;New Query&amp;quot;, paste the script below and click on &amp;quot;Execute&amp;quot;. To see what value to use in the condition for &amp;quot;OPTIMIZATION.OptimizationNo&amp;quot; and &amp;quot;SIMULATION.SimNo&amp;quot;, open the tables dbo.Optimization and dbo.Simulation, respectively, and look for the correct result sets.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Peder</name></author>
	</entry>
	<entry>
		<id>https://www.heurekaslu.se/w/index.php?title=SQL_Queries&amp;diff=8223&amp;oldid=prev</id>
		<title>Peder at 18:16, 7 March 2016</title>
		<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=SQL_Queries&amp;diff=8223&amp;oldid=prev"/>
		<updated>2016-03-07T18:16:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:16, 7 March 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Result Variables]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you are interested in results that you for some reason cannot obtain with the tools available in the applications, you can always run queries in SQL Server Management Studio. The results consists of several tables that must be joined. Below is one example of a query that creates a list of stand-level treatments for a selected optimization. To run this script, open SQL Server Management Studio, connect to the database server, and right-click &amp;quot;My_Heureka_Results&amp;quot; (or corresponding). Choose &amp;quot;New Query&amp;quot;, paste the script below and click on &amp;quot;Execute&amp;quot;. To see what value to use in the condition for &amp;quot;OPTIMIZATION.OptimizationNo&amp;quot; and &amp;quot;SIMULATION.SimNo&amp;quot;, open the tables dbo.Optimization and dbo.Simulation, respectively, and look for the correct result sets.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you are interested in results that you for some reason cannot obtain with the tools available in the applications, you can always run queries in SQL Server Management Studio. The results consists of several tables that must be joined. Below is one example of a query that creates a list of stand-level treatments for a selected optimization. To run this script, open SQL Server Management Studio, connect to the database server, and right-click &amp;quot;My_Heureka_Results&amp;quot; (or corresponding). Choose &amp;quot;New Query&amp;quot;, paste the script below and click on &amp;quot;Execute&amp;quot;. To see what value to use in the condition for &amp;quot;OPTIMIZATION.OptimizationNo&amp;quot; and &amp;quot;SIMULATION.SimNo&amp;quot;, open the tables dbo.Optimization and dbo.Simulation, respectively, and look for the correct result sets.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Peder</name></author>
	</entry>
	<entry>
		<id>https://www.heurekaslu.se/w/index.php?title=SQL_Queries&amp;diff=8221&amp;oldid=prev</id>
		<title>Peder at 18:13, 7 March 2016</title>
		<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=SQL_Queries&amp;diff=8221&amp;oldid=prev"/>
		<updated>2016-03-07T18:13:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:13, 7 March 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Results&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Result Variables&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you are interested in results that you for some reason cannot obtain with the tools available in the applications, you can always run queries in SQL Server Management Studio. The results consists of several tables that must be joined. Below is one example of a query that creates a list of stand-level treatments for a selected optimization. To run this script, open SQL Server Management Studio, connect to the database server, and right-click &amp;quot;My_Heureka_Results&amp;quot; (or corresponding). Choose &amp;quot;New Query&amp;quot;, paste the script below and click on &amp;quot;Execute&amp;quot;. To see what value to use in the condition for &amp;quot;OPTIMIZATION.OptimizationNo&amp;quot; and &amp;quot;SIMULATION.SimNo&amp;quot;, open the tables dbo.Optimization and dbo.Simulation, respectively, and look for the correct result sets.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If you are interested in results that you for some reason cannot obtain with the tools available in the applications, you can always run queries in SQL Server Management Studio. The results consists of several tables that must be joined. Below is one example of a query that creates a list of stand-level treatments for a selected optimization. To run this script, open SQL Server Management Studio, connect to the database server, and right-click &amp;quot;My_Heureka_Results&amp;quot; (or corresponding). Choose &amp;quot;New Query&amp;quot;, paste the script below and click on &amp;quot;Execute&amp;quot;. To see what value to use in the condition for &amp;quot;OPTIMIZATION.OptimizationNo&amp;quot; and &amp;quot;SIMULATION.SimNo&amp;quot;, open the tables dbo.Optimization and dbo.Simulation, respectively, and look for the correct result sets.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SELECT     SIMULATION.SimNo, TREATMENTUNIT.Description, TREATMENTUNIT.Area AS AvdProdArea,  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;SELECT     SIMULATION.SimNo, TREATMENTUNIT.Description, TREATMENTUNIT.Area AS AvdProdArea,  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                       TREATMENTUNIT.Area * OPTIMIZATIONRESULT.Proportion AS &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;, RESULT.AlternativeNo, RESULT_TREATMENTDATA.RowNo AS &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;,  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                       TREATMENTUNIT.Area * OPTIMIZATIONRESULT.Proportion AS &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Åtgärdsareal&lt;/ins&gt;, RESULT.AlternativeNo, RESULT_TREATMENTDATA.RowNo AS &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ÅtgärdsNr&lt;/ins&gt;,  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                       RESULT.Period, RESULT_TREATMENTDATA.Year AS &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;, TREATMENTTYPE.Description AS &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;,  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                       RESULT.Period, RESULT_TREATMENTDATA.Year AS &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;År&lt;/ins&gt;, TREATMENTTYPE.Description AS &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Åtgärd&lt;/ins&gt;,  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                       RESULT_FORESTDATA.MeanAgeTotal_Before AS Medelålder, RESULT_TREATMENTDATA.VolumeCutTotal AS VolAvv,  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                       RESULT_FORESTDATA.MeanAgeTotal_Before AS Medelålder, RESULT_TREATMENTDATA.VolumeCutTotal AS VolAvv,  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                       RESULT_VALUEDATA.Net AS Netto, OPTIMIZATIONRESULT.Proportion AS Andel, OPTIMIZATION.OptimizationNo&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                       RESULT_VALUEDATA.Net AS Netto, OPTIMIZATIONRESULT.Proportion AS Andel, OPTIMIZATION.OptimizationNo&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Peder</name></author>
	</entry>
	<entry>
		<id>https://www.heurekaslu.se/w/index.php?title=SQL_Queries&amp;diff=4694&amp;oldid=prev</id>
		<title>Peder: Created page with &#039;Category:Results If you are interested in results that you for some reason cannot obtain with the tools available in the applications, you can always run queries in SQL Serve�?�&#039;</title>
		<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=SQL_Queries&amp;diff=4694&amp;oldid=prev"/>
		<updated>2010-06-18T07:15:27Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;&lt;a href=&quot;/wiki/Category:Results&quot; class=&quot;mw-redirect&quot; title=&quot;Category:Results&quot;&gt;Category:Results&lt;/a&gt; If you are interested in results that you for some reason cannot obtain with the tools available in the applications, you can always run queries in SQL Serve�?�&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Results]]&lt;br /&gt;
If you are interested in results that you for some reason cannot obtain with the tools available in the applications, you can always run queries in SQL Server Management Studio. The results consists of several tables that must be joined. Below is one example of a query that creates a list of stand-level treatments for a selected optimization. To run this script, open SQL Server Management Studio, connect to the database server, and right-click &amp;quot;My_Heureka_Results&amp;quot; (or corresponding). Choose &amp;quot;New Query&amp;quot;, paste the script below and click on &amp;quot;Execute&amp;quot;. To see what value to use in the condition for &amp;quot;OPTIMIZATION.OptimizationNo&amp;quot; and &amp;quot;SIMULATION.SimNo&amp;quot;, open the tables dbo.Optimization and dbo.Simulation, respectively, and look for the correct result sets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SELECT     SIMULATION.SimNo, TREATMENTUNIT.Description, TREATMENTUNIT.Area AS AvdProdArea, &lt;br /&gt;
                      TREATMENTUNIT.Area * OPTIMIZATIONRESULT.Proportion AS �?tgärdsareal, RESULT.AlternativeNo, RESULT_TREATMENTDATA.RowNo AS �?tgärdsNr, &lt;br /&gt;
                      RESULT.Period, RESULT_TREATMENTDATA.Year AS �?r, TREATMENTTYPE.Description AS �?tgärd, &lt;br /&gt;
                      RESULT_FORESTDATA.MeanAgeTotal_Before AS Medelålder, RESULT_TREATMENTDATA.VolumeCutTotal AS VolAvv, &lt;br /&gt;
                      RESULT_VALUEDATA.Net AS Netto, OPTIMIZATIONRESULT.Proportion AS Andel, OPTIMIZATION.OptimizationNo&lt;br /&gt;
FROM         RESULT INNER JOIN&lt;br /&gt;
                      TREATMENTUNIT ON RESULT.SimulationGuid = TREATMENTUNIT.SimulationGuid AND &lt;br /&gt;
                      RESULT.TreatmentUnitGUID = TREATMENTUNIT.TreatmentUnitGUID INNER JOIN&lt;br /&gt;
                      RESULT_FORESTDATA ON RESULT.ResultGuid = RESULT_FORESTDATA.ResultGuid INNER JOIN&lt;br /&gt;
                      SIMULATION ON RESULT.SimulationGuid = SIMULATION.SimulationGuid INNER JOIN&lt;br /&gt;
                      OPTIMIZATIONRESULT ON RESULT.TreatmentUnitGUID = OPTIMIZATIONRESULT.TreatmentUnitGuid AND &lt;br /&gt;
                      RESULT.AlternativeNo = OPTIMIZATIONRESULT.AlternativeNo AND RESULT.SimulationGuid = OPTIMIZATIONRESULT.SimulationGuid INNER JOIN&lt;br /&gt;
                      OPTIMIZATION ON OPTIMIZATIONRESULT.OptimizationGuid = OPTIMIZATION.OptimizationGuid AND &lt;br /&gt;
                      OPTIMIZATIONRESULT.SimulationGuid = OPTIMIZATION.SimulationGuid FULL OUTER JOIN&lt;br /&gt;
                      TREATMENTTYPE RIGHT OUTER JOIN&lt;br /&gt;
                      RESULT_VALUEDATA INNER JOIN&lt;br /&gt;
                      RESULT_TREATMENTDATA ON RESULT_VALUEDATA.ResultGuid = RESULT_TREATMENTDATA.ResultGuid AND &lt;br /&gt;
                      RESULT_VALUEDATA.RowNo = RESULT_TREATMENTDATA.RowNo ON TREATMENTTYPE.Code = RESULT_TREATMENTDATA.Treatment ON &lt;br /&gt;
                      RESULT.ResultGuid = RESULT_TREATMENTDATA.ResultGuid--&lt;br /&gt;
WHERE     (OPTIMIZATIONRESULT.Proportion &amp;gt; 0) and (OPTIMIZATION.OptimizationNo = 0) AND (SIMULATION.SimNo = 1) AND &lt;br /&gt;
                      (RESULT_TREATMENTDATA.Treatment &amp;gt; 0)&lt;br /&gt;
ORDER BY TREATMENTUNIT.Description, RESULT.AlternativeNo, RESULT.Period&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peder</name></author>
	</entry>
</feed>