You are here: Re: Group SQL Select Statement « MsSQL Server « IT news, forums, messages
Re: Group SQL Select Statement

Posted by Andreas on 03/23/07 18:45

MS Query tells me ORA-00979: not a GROUP BY expression. Are there only
certain fields that I can group by?


On Mar 23, 2:22 pm, "MC" <marko.NOSPAMc...@gmail.com> wrote:
> Something like this=
>
> Select
> SCDMASTER.SCTY_CLASS_CODE,
> sum(CUSTODY_BALANCE.OPENING_BALANCE +
> CUSTODY_BALANCE.DEPOSIT_AMOUNT -CUSTODY_BALANCE.WITHDRAWAL_AMOUNT)
>
> from
> PMCAPSHIST.CUSTODY_BALANCE CUSTODY_BALANCE,
> CAPSREPORT.SCDMASTER SCDMASTER
> where
> CUSTODY_BALANCE.ASSET_ID = SCDMASTER.CUSIP_ID AND
> ((CUSTODY_BALANCE.APPLICATIONCYCLEDATE={ts '2007-03-21 00:00:00'}) AND
> (SCDMASTER.SCTY_CLASS_CODE Not In
> ('BILL','NOTE','BOND','CD','BD','CB','TINT','TPRN','CA','YD')))
> group by
> SCDMASTER.SCTY_CLASS_CODE
>
> MC
>
> "Andreas" <andreas.strzo...@ny.frb.org> wrote in message
>
> news:1174673610.080198.22590@y66g2000hsf.googlegroups.com...
>
>
>
> > Hi,
>
> > I am bloody amateure and I was wondering if someone could help me edit
> > the statement below so it groups the field SCDMASTER.SCTY_CLASS_CODE
> > and creates one field called "total balance" equalling
> > CUSTODY_BALANCE.OPENING_BALANCE + CUSTODY_BALANCE.DEPOSIT_AMOUNT -
> > CUSTODY_BALANCE.WITHDRAWAL_AMOUNT
>
> > SELECT
> > CUSTODY_BALANCE.APPLICATIONCYCLEDATE,
> > CUSTODY_BALANCE.ASSET_ID,
> > SCDMASTER.SCTY_CLASS_CODE,
> > CUSTODY_BALANCE.OPENING_BALANCE,
> > CUSTODY_BALANCE.DEPOSIT_AMOUNT,
> > CUSTODY_BALANCE.WITHDRAWAL_AMOUNT
> > FROM
> > FPMCAPSHIST.CUSTODY_BALANCE CUSTODY_BALANCE,
> > CAPSREPORT.SCDMASTER SCDMASTER
> > WHERE
> > CUSTODY_BALANCE.ASSET_ID = SCDMASTER.CUSIP_ID AND
> > ((CUSTODY_BALANCE.APPLICATIONCYCLEDATE={ts '2007-03-21 00:00:00'}) AND
> > (SCDMASTER.SCTY_CLASS_CODE Not In
> > ('BILL','NOTE','BOND','CD','BD','CB','TINT','TPRN','CA','YD')))
>
> > Thanks,
>
> > Andreas- Hide quoted text -
>
> - Show quoted text -

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация