<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl or PHP or KSH and SQL in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768439#M942437</link>
    <description>In the example above the records&lt;BR /&gt;&lt;BR /&gt;2002/07/04 Test2 7 4 &lt;BR /&gt;2002/07/05 Test4 35 5 &lt;BR /&gt;&lt;BR /&gt;have not occured four times in a row based on the date field.&lt;BR /&gt;&lt;BR /&gt;But&lt;BR /&gt;&lt;BR /&gt;the answer that you are looking for is: &lt;BR /&gt;&lt;BR /&gt;select `date`, count(*)&lt;BR /&gt;from tablename where&lt;BR /&gt;V2 &amp;gt; 1&lt;BR /&gt;group by date&lt;BR /&gt;having count(*) &amp;gt;4&lt;BR /&gt;&lt;BR /&gt;MySQL can't do subqueries yet so you can't display all four fields as the result, unless you create the above query as view and join it to the original table on DATE.&lt;BR /&gt;&lt;BR /&gt;Good luck.</description>
    <pubDate>Mon, 22 Jul 2002 06:18:45 GMT</pubDate>
    <dc:creator>Victor Geere</dc:creator>
    <dc:date>2002-07-22T06:18:45Z</dc:date>
    <item>
      <title>Perl or PHP or KSH and SQL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768436#M942434</link>
      <description>Hello,&lt;BR /&gt;It seems like, I keep coming back here because everytime I have a question, I always get a good answer here..&lt;BR /&gt;&lt;BR /&gt;Here is my new question&lt;BR /&gt;&lt;BR /&gt;I am trying to query mysql database based on a rule and would really appreciate any help &lt;BR /&gt;&lt;BR /&gt;I need to be able to query any records that match the result where V3 is &amp;gt; 1 and has occured 4 times in a row based on the date field.&lt;BR /&gt;for example in this record: &lt;BR /&gt;DATE       V1    V2&lt;BR /&gt;2002/07/01 Test1 0&lt;BR /&gt;2002/07/02 Test1 1&lt;BR /&gt;2002/07/03 Test1 1&lt;BR /&gt;2002/07/01 Test2 3&lt;BR /&gt;2002/07/02 Test2 9&lt;BR /&gt;2002/07/03 Test2 5&lt;BR /&gt;2002/07/04 Test2 7&lt;BR /&gt;2002/07/04 Test1 0&lt;BR /&gt;2002/07/01 Test4 3&lt;BR /&gt;2002/07/02 Test4 5&lt;BR /&gt;2002/07/03 Test4 7&lt;BR /&gt;2002/07/04 Test4 9&lt;BR /&gt;2002/07/05 Test4 35&lt;BR /&gt;&lt;BR /&gt;So in this case above, my report should show this:&lt;BR /&gt;DATE        V1    V2  V3&lt;BR /&gt;2002/07/04  Test2 7   4&lt;BR /&gt;2002/07/05  Test4 35  5&lt;BR /&gt;where&lt;BR /&gt;Date is last date of ocurrnace and&lt;BR /&gt;V3 value of the number of times it happended where V2 &amp;gt; 1 &amp;gt; 4 days days in a row.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for any help ..&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Jul 2002 08:50:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768436#M942434</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-07-20T08:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Perl or PHP or KSH and SQL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768437#M942435</link>
      <description>BTW:&lt;BR /&gt;MySQL Record can be as big as 300,000 lines...&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Jul 2002 08:52:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768437#M942435</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-07-20T08:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: Perl or PHP or KSH and SQL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768438#M942436</link>
      <description>"I need to be able to query any records that match the result where V3 is &amp;gt; 1 and has occured 4 times in a row based on the date field. &lt;BR /&gt;for example in this record:"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I ment where V2 or last field...&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Jul 2002 09:10:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768438#M942436</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-07-20T09:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Perl or PHP or KSH and SQL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768439#M942437</link>
      <description>In the example above the records&lt;BR /&gt;&lt;BR /&gt;2002/07/04 Test2 7 4 &lt;BR /&gt;2002/07/05 Test4 35 5 &lt;BR /&gt;&lt;BR /&gt;have not occured four times in a row based on the date field.&lt;BR /&gt;&lt;BR /&gt;But&lt;BR /&gt;&lt;BR /&gt;the answer that you are looking for is: &lt;BR /&gt;&lt;BR /&gt;select `date`, count(*)&lt;BR /&gt;from tablename where&lt;BR /&gt;V2 &amp;gt; 1&lt;BR /&gt;group by date&lt;BR /&gt;having count(*) &amp;gt;4&lt;BR /&gt;&lt;BR /&gt;MySQL can't do subqueries yet so you can't display all four fields as the result, unless you create the above query as view and join it to the original table on DATE.&lt;BR /&gt;&lt;BR /&gt;Good luck.</description>
      <pubDate>Mon, 22 Jul 2002 06:18:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768439#M942437</guid>
      <dc:creator>Victor Geere</dc:creator>
      <dc:date>2002-07-22T06:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Perl or PHP or KSH and SQL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768440#M942438</link>
      <description>Thanks for replying but all that gave me is how many times V1 occured if V2 &amp;gt; 1 ???&lt;BR /&gt;&lt;BR /&gt;Does not help ..&lt;BR /&gt;&lt;BR /&gt;Basically in a nut shell;&lt;BR /&gt;Need how many times an event occured for V1 when V2 &amp;gt;1 and happened 4 days in a row .. based on date ...must be dates in a row ...&lt;BR /&gt;&lt;BR /&gt;Thanks for any more help ...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Jul 2002 22:30:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768440#M942438</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-07-22T22:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Perl or PHP or KSH and SQL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768441#M942439</link>
      <description>&lt;BR /&gt;Why not return the rows to perl and use perl to perform your logic? look at the dbi modules to interface to mysql.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.mysql.com/downloads/api-dbi.html" target="_blank"&gt;http://www.mysql.com/downloads/api-dbi.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;look here for a sample of code, looping through the rows:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hotwired.lycos.com/webmonkey/98/24/index3a_page3.html?tw=backend" target="_blank"&gt;http://hotwired.lycos.com/webmonkey/98/24/index3a_page3.html?tw=backend&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 22 Jul 2002 23:51:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768441#M942439</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-07-22T23:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Perl or PHP or KSH and SQL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768442#M942440</link>
      <description>harry,&lt;BR /&gt;I am cluless when comes to Perl,..But I do know that Perl did prove many things for me before many times ...&lt;BR /&gt;&lt;BR /&gt;I have tried this before with PHP and performance was very poor ...So I do like to give it a shot using Perl but I have not experience in Perl.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Do you think you can help me with this script ...&lt;BR /&gt;&lt;BR /&gt;I really do appreciate any help you could provide ..&lt;BR /&gt;&lt;BR /&gt;Thanks in advance...&lt;BR /&gt;</description>
      <pubDate>Fri, 26 Jul 2002 22:19:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-or-php-or-ksh-and-sql/m-p/2768442#M942440</guid>
      <dc:creator>Nabil_2</dc:creator>
      <dc:date>2002-07-26T22:19:08Z</dc:date>
    </item>
  </channel>
</rss>

