title: My SQL query Difference between two Dates?
body: <p>My DataBaseTable looks as follow</p>
  <pre><code>&gt; Date                    Value 
  &gt; 2020-09-05 00:00:05     20.58 --&gt; first value
  &gt; 2020-09-05 00:01:05     20.59 
  &gt; ..... 
  &gt; 2020-09-05 23:59:05     21.00 --&gt; last value
  </code></pre>
  <p>Result should be 21.00 - 20.58 = 0.42</p>
  <p>I want for example built a difference over a day.
  With this query I get the first and last value, in my c# project I can then calculate the difference</p>
  <pre><code>WITH T AS (
     SELECT *
     FROM fernleitung
     WHERE `Date` between '2020.09.05-00:00:00' AND '2020.09.06-00:00:00'
     )
     (SELECT * FROM T ORDER BY Date LIMIT 1)
     UNION ALL
     (SELECT * FROM T ORDER BY Date DESC LIMIT 1);
  </code></pre>
  <p>Is there an easier way to do this with an SQL query?</p>
  <p>Many Thanks,
  Markus</p>