<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div>Hallo,</div><div>Ich exportiere Daten aus der vz DB mit diesem Script (nur bestimmte Channels):</div><div><br></div><div><pre class="code"> select channel_id, timestamp,value from data
where from_unixtime(timestamp/1000) > ('2015-06-05 12:43:16')
and from_unixtime(timestamp/1000) < ('2015-08-06 09:40:37')
and channel_id > 12 and channel_id < 20
INTO outfile '/tmp/last_values' fields terminated by ‚;</pre><pre class="code"><br></pre><pre class="code">Du kannst ja die Daten vor dem löschen selektieren um zu prüfen ob es die richtigen sind:</pre><pre class="code"> </pre><pre class="code"> select channel_id, timestamp,value from data
where from_unixtime(timestamp/1000) > ('2015-06-05 12:43:16')
and from_unixtime(timestamp/1000) < ('2015-08-06 09:40:37')
and channel_id > 12 and channel_id < 20;</pre><pre class="code"><br></pre><pre class="code">Löschen:</pre><pre class="code"><pre class="code">delete from data
where from_unixtime(timestamp/1000) > ('2015-06-05 12:43:16')
and from_unixtime(timestamp/1000) < ('2015-08-06 09:40:37')
and channel_id > 12 and channel_id < 20;</pre><pre class="code"><span style="font-size: 10pt;"><br></span></pre><pre class="code"><span style="font-size: 10pt;">Gruss</span></pre><pre class="code"><span style="font-size: 10pt;">Friedrich </span></pre></pre></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">Von: </span> fambesse <<a href="mailto:thomas@fambesse.de">thomas@fambesse.de</a>><br><span style="font-weight:bold">Antworten an: </span> "volkszaehler.org - users" <<a href="mailto:volkszaehler-users@demo.volkszaehler.org">volkszaehler-users@demo.volkszaehler.org</a>><br><span style="font-weight:bold">Datum: </span> Mittwoch, 23. August 2017 09:42<br><span style="font-weight:bold">An: </span> <<a href="mailto:volkszaehler-users@lists.volkszaehler.org">volkszaehler-users@lists.volkszaehler.org</a>><br><span style="font-weight:bold">Betreff: </span> [vz-users] Daten aus Datenbank löschen<br></div><div><br></div><div xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Courier;
panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:inherit;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Vorformatiert Zchn";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLVorformatiertZchn
{mso-style-name:"HTML Vorformatiert Zchn";
mso-style-priority:99;
mso-style-link:"HTML Vorformatiert";
font-family:"Courier New";
mso-fareast-language:DE;}
span.kwd
{mso-style-name:kwd;}
span.pln
{mso-style-name:pln;}
span.pun
{mso-style-name:pun;}
span.str
{mso-style-name:str;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--><div lang="DE" link="#0563C1" vlink="#954F72"><div class="WordSection1"><p class="MsoNormal">Hallo zusammen, <o:p></o:p></p><p class="MsoNormal">leider ist mein SQL etwas eingerostet und ich hoffe hier kann mir jemand helfen. <o:p></o:p></p><p class="MsoNormal">Ich möchte gerne von einem Tag bzw. zwischen zwei Tagen oder zwei Timestamps die Daten löschen.<o:p></o:p></p><p class="MsoNormal">Hier haben sich bei mir an einem Tag falsche Werte eingeschlichen. <o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal">Folgendes habe ich habe ich schon probiert:<o:p></o:p></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"inherit",serif;color:#101094;border:none windowtext 1.0pt;padding:0cm;background:#EFF0F1;mso-fareast-language:DE"><o:p> </o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"inherit",serif;color:#101094;border:none windowtext 1.0pt;padding:0cm;background:#EFF0F1;mso-fareast-language:DE">SELECT * FROM 'data' WHERE `timestamp` BETWEEN '1502229600' AND '1502316000';<o:p></o:p></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"inherit",serif;color:#101094;border:none windowtext 1.0pt;padding:0cm;background:#EFF0F1;mso-fareast-language:DE"><o:p> </o:p></span></p><p class="MsoNormal">Die Timestamps sollten der 09.08.2017 00:00:00 bis 10.08.2017 00:00:00 sein.<o:p></o:p></p><p class="MsoNormal">Besten Dank vorab.<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><o:p> </o:p></p><p class="MsoNormal"><span style="font-family:Courier;color:black;mso-fareast-language:DE">----------------------------------------------------------</span><span style="font-family: 'Times New Roman', serif; color: black;"> </span><span style="mso-fareast-language:DE"><o:p></o:p></span></p><p class="MsoNormal"><span style="font-family:Courier;color:black;mso-fareast-language:DE">Thomas Besse </span><span style="font-family: 'Times New Roman', serif; color: black;"> </span><span style="mso-fareast-language:DE"><o:p></o:p></span></p><p class="MsoNormal"><span style="font-family:Courier;color:black;mso-fareast-language:DE">57250 Netphen e-mail: <a href="mailto:thomas@fambesse.de"><span style="color:#0563C1">thomas@fambesse.de</span></a> </span><span style="font-family: 'Times New Roman', serif; color: black;"> </span><span style="mso-fareast-language:DE"><o:p></o:p></span></p><p class="MsoNormal"><span style="font-family:Courier;color:black;mso-fareast-language:DE">----------------------------------------------------------</span><span style="mso-fareast-language:DE"> <o:p></o:p></span></p><p class="MsoNormal"><o:p> </o:p></p></div></div></div></span></body></html>