[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Syntax for Count(*)



I gotcha....usually I put my "lets" right after the begin-procedure otherwise I 
do my selects.  Sometimes I put my "lets" after the field...others, I group 
them after all the fields.

Sam

<<< Carlton Conley <cconley@CDG-INC.COM>  4/ 2  8:39a >>>
No as Tony stated it the restriction is in between the begin and end selects
or other SQL statements (i.e. update, delete) not the begin-report, program
or procedure.

Though for clarity and formating I indent all my non-sql lines within those
headings.

-----Original Message-----
From: Discussion of SQR, SQRIBE Technologies's database reporting
language [mailto:SQR-USERS@list.iex.net]On Behalf Of Sam Spritzer
Sent: Friday, April 02, 1999 6:50 AM
To: Multiple recipients of list SQR-USERS
Subject: Re: Syntax for Count(*)


In almost all cases, the first line is usually "begin-Procedure" so it seems
that this rule is redundant anyway.

Sam

<<< Tony DeLia <tdelia@EROLS.COM>  4/ 2  7:33a >>>
Clarification:

You can't have non-SQL lines (eg, let ...) start in the 1st 'position'
WITHIN the begin-select and end-select... The first position is for
select columns... and subsequent SQL (eg, from, where, ...)

...
!   Below is outside of select (Position 1) - OKAY
let #ERNctr = 0

begin-select

b.erncd
count(*)     &b.count

  !   Below is indented (Not in Position 1) - OKAY
  let #ERNctr                = #ERNctr   1
  let ERNmtx.ERNttl(#ERNctr) = &b.erncd
  if  #ERNctr >= 10
      exit-select
  end-if

 from s_dhm_emp_detail   b
where ...
group by b.erncd
order by 2 desc, 1

end-select

...

                             Tony DeLia

Kibler, Daniel R - CFC wrote:
>
> Is the layout correct? You can't have non-SQL lines (eg, let ...) start in
> the 1st column.
>
> You also need to group on erncd.
> Daniel Kibler

--
Tony DeLia
AnswerThink Consulting Group
PeopleSoft Solutions Practice - Delphi Partners
tdelia@erols.com