<?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: Oracle Query Help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013840#M911982</link>
    <description>select savings,count(*) from table group by savings;&lt;BR /&gt;select checking,count(*) from table group by checking;&lt;BR /&gt;select funds,count(*) from table group by funds;&lt;BR /&gt;&lt;BR /&gt;You could also do something like:&lt;BR /&gt;select savings,checking,funds,count(*) from table group by savings,checking,funds;&lt;BR /&gt;&lt;BR /&gt;This would give you a tabular count of customers with different forms of accounts (ie: customers with savings and checking).  You should get 9 rows.&lt;BR /&gt;&lt;BR /&gt;If you need something more specific, post back with exact details.  &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Brian</description>
    <pubDate>Wed, 02 Jul 2003 19:05:47 GMT</pubDate>
    <dc:creator>Brian Crabtree</dc:creator>
    <dc:date>2003-07-02T19:05:47Z</dc:date>
    <item>
      <title>Oracle Query Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013838#M911980</link>
      <description>have a table with,&lt;BR /&gt;&lt;BR /&gt;Structure&lt;BR /&gt;&lt;BR /&gt;Cus_num,Savings,Checking,Funds&lt;BR /&gt;&lt;BR /&gt;Data&lt;BR /&gt;&lt;BR /&gt;C100,1,0,0 (1 means customer has that account)&lt;BR /&gt;C200,0,1,0&lt;BR /&gt;C300,0,0,1&lt;BR /&gt;C400,0,1,0&lt;BR /&gt;C500,1,0,0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;How to find out (need a query),&lt;BR /&gt;how many customers have savings &lt;BR /&gt;how many customers have checking &lt;BR /&gt;how many customers have funds &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Raj&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2003 17:17:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013838#M911980</guid>
      <dc:creator>Prabhu_7</dc:creator>
      <dc:date>2003-07-02T17:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Query Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013839#M911981</link>
      <description>Prabhu,&lt;BR /&gt;  If I understood your question correctly then,&lt;BR /&gt;&lt;BR /&gt;  select count(*) from customers where savings=1&lt;BR /&gt;  select count(*) from customers where checking=1&lt;BR /&gt;  select count(*) from customers where funds=1&lt;BR /&gt;&lt;BR /&gt;  will do.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Umapathy&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2003 17:24:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013839#M911981</guid>
      <dc:creator>Umapathy S</dc:creator>
      <dc:date>2003-07-02T17:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Query Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013840#M911982</link>
      <description>select savings,count(*) from table group by savings;&lt;BR /&gt;select checking,count(*) from table group by checking;&lt;BR /&gt;select funds,count(*) from table group by funds;&lt;BR /&gt;&lt;BR /&gt;You could also do something like:&lt;BR /&gt;select savings,checking,funds,count(*) from table group by savings,checking,funds;&lt;BR /&gt;&lt;BR /&gt;This would give you a tabular count of customers with different forms of accounts (ie: customers with savings and checking).  You should get 9 rows.&lt;BR /&gt;&lt;BR /&gt;If you need something more specific, post back with exact details.  &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Wed, 02 Jul 2003 19:05:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013840#M911982</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-07-02T19:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Query Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013841#M911983</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;As brian said above, quite difficult to help here unless you feed us additional information.&lt;BR /&gt;&lt;BR /&gt;Anyway, if you are trying to write a query that satisfies all these criteria, you should should have a where condition:&lt;BR /&gt;&lt;BR /&gt;select count (*)&lt;BR /&gt;  from customers&lt;BR /&gt; where savings &amp;gt;1 &lt;BR /&gt;   and checking &amp;gt; 1&lt;BR /&gt;   and funds  &amp;gt;1;&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Thu, 03 Jul 2003 03:34:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013841#M911983</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2003-07-03T03:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Oracle Query Help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013842#M911984</link>
      <description>There are more powerful SQL features nowadays, including CASE.&lt;BR /&gt;How about something like:&lt;BR /&gt;&lt;BR /&gt;SELECT&lt;BR /&gt;SUM (CASE WHEN SAVINGS  &amp;gt; 0 AND SAVINGS  IS NOT NULL THEN 1 ELSE 0 END) as "Number with savings",&lt;BR /&gt;SUM (CASE WHEN CHECKING &amp;gt; 0 AND CHECKING IS NOT NULL THEN 1 ELSE 0 END) as "Number with checking",&lt;BR /&gt;SUM (CASE WHEN FUNDS    &amp;gt; 0 AND FUNDS    IS NOT NULL THEN 1 ELSE 0 END) as "Number with funds"&lt;BR /&gt;FROM YOUR_TABLE&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Jul 2003 10:51:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-query-help/m-p/3013842#M911984</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-07-03T10:51:51Z</dc:date>
    </item>
  </channel>
</rss>

