Loading ...
Sorry, an error occurred while loading the content.

Re: [baseball-databank] query question

Expand Messages
  • Randy Fiato
    MySQL also has an IF expression with a similar syntax. PostgreSQL has a CASE-WHEN construct that should accomplish the same thing (I think). Randy System
    Message 1 of 5 , Mar 26, 2004
    • 0 Attachment
      MySQL also has an IF expression with a similar syntax. PostgreSQL has a
      CASE-WHEN construct that should accomplish the same thing (I think).

      Randy
      System Administrator, Big League Forums <http://www.bigleagueforums.net/>
      ----- Original Message -----
      From: <tmasc@...>
      To: <baseball-databank@yahoogroups.com>
      Sent: Friday, March 26, 2004 7:54 PM
      Subject: Re: [baseball-databank] query question


      > Try something like:
      >
      > select playerid, year, sum(g) as Gtot,
      > sum(Iif(pos=2,g,0)) as G2
      > from fielding
      > group by playerid, year
      >
      > This will only work with Access. I don't think other
      > DBMS will allow an IF. If that's needed, you have to
      > create another table to join to. Let me know if you
      > need that.
      >
      > Tom
      >
      >
      > --- rscarpel <rscarpel@...> wrote:
      > > Would anyone know how to do a query where I could
      > > get the following
      > > output: Player ID, Year, Total Fielding Games,
      > > Games at Catcher.
      > >
      > > I am trying to get one line for each players year
      > > that will tell me
      > > total fielding games for the year with the number of
      > > fielding games
      > > at catcher for that season next to it.
      > >
      > > Thanks for any help.
      > >
      > >
      > >
      > > ------------------------ Yahoo! Groups Sponsor
      > >
      > > http://www.baseball-databank.org/
      > > Yahoo! Groups Links
      > >
      > > http://groups.yahoo.com/group/baseball-databank/
      > >
      > > baseball-databank-unsubscribe@yahoogroups.com
      > >
      > >
      > >
      >
      >
      > __________________________________
      > Do you Yahoo!?
      > Yahoo! Finance Tax Center - File online. File on time.
      > http://taxes.yahoo.com/filing.html
      >
      >
      >
      > http://www.baseball-databank.org/
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
    • Joe Goldner
      We at WEBEUSA, custom design websites for the business community. If you are interested in a website for your business or want to upgrade your site please
      Message 2 of 5 , Mar 26, 2004
      • 0 Attachment
        We at WEBEUSA, custom design websites for the business community. If you are interested in a website for your business or want to upgrade your site please check us out at our website at www.webeusa.com . Check out our portfolio, click on the prices on the home page and you will see a demo of the site we can custom design for you and your business. Also check out our hosting features and prices. We also now optimize your website, keeping it in the top 50 for a fee. For further details and for a free web consultation please call me at 866-703-6565 or email me at joe@... . 

        Joe Goldner

        954-597-2929

        joe@...

        www.webeusa.com

         

        rscarpel <rscarpel@...> wrote:
        Would anyone know how to do a query where I could get the following
        output:  Player ID, Year, Total Fielding Games, Games at Catcher.

        I am trying to get one line for each players year that will tell me
        total fielding games for the year with the number of fielding games
        at catcher for that season next to it.

        Thanks for any help.



        http://www.baseball-databank.org/



        Do you Yahoo!?
        Yahoo! Finance Tax Center - File online. File on time.
      Your message has been successfully submitted and would be delivered to recipients shortly.