Subject | Re: [ib-support] Using aliases in the same select clause |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2002-10-30T10:03:04Z |
At 14:29 29.10.2002 +0200, you wrote:
repairauthorisation and reasonsforrejection, so I cannot see how
authoriseddate actually matters for the subselect.
Set
>The query at the moment looks like this which does not look veryAre you sure, Gerhardus? You seem to have no link between
>elegant. It works however...
repairauthorisation and reasonsforrejection, so I cannot see how
authoriseddate actually matters for the subselect.
Set
>select
> ra.reasonsforrejection,
> (
> select count(darno)
> from repairauthorisation
> where AUTHORISED = '0' and
> (ra.AUTHORISEDDATE between :StartDate and :EndDate)
> )as CountPerReason,
> count(ra.darno)as NumberofRejections,
> (
> cast((count(ra.darno))*100/
> (
> select count(darno)
> from repairauthorisation
> where AUTHORISED = '0' and
> (ra.AUTHORISEDDATE between :StartDate and :EndDate))as
>varchar(4))||'%'
> )as Percentage
>
>from repairauthorisation ra
>where ra.AUTHORISED = '0' and
>(ra.AUTHORISEDDATE between :StartDate and :EndDate)
>group by ra.reasonsforrejection