RE: Query help !
- From: Amit Jain <jain_amit@xxxxxxxxx>
- Date: Tue, 16 Aug 2005 21:49:01 -0700
Hello Ronny,
Pls clarify the %age against the
- total records count in table or
- Total records counts in SYS.Client_Version0
As you are using 2 columns in your select query
For first case solution is already provided.
But for secound case , find the query
SELECT SYS.Client_Version0,
SYS.Client_Type0, ((count(*) * 100)/( SELECT count(*) FROM v_R_System as
Sub_SYS WHERE SYS.Client0=1 and Sub_SYS.Client_Version0 =
SYS.Client_Version0)) as 'Percentage'
FROM v_R_System as SYS
WHERE SYS.Client0=1
group by SYS.Client_Version0, SYS.Client_Type0
order by SYS.Client_Version0, SYS.Client_Type0
(Untested)
"Ronny de Jong" wrote:
> Dear all,
>
> I'd like to display the result of this query in percentage:
>
> SELECT SYS.Client_Version0, SYS.Client_Type0, count(*) as 'Count'
> FROM v_R_System as SYS
> WHERE SYS.Client0=1
> group by SYS.Client_Version0, SYS.Client_Type0
> order by SYS.Client_Version0, SYS.Client_Type0
>
> Any idea's how,
>
> I appreciate your help....
> Ronny
.
- References:
- Query help !
- From: Ronny de Jong
- Query help !
- Prev by Date: Re: Query help !
- Next by Date: Having a stored procedure copy tables & also preserve indexing/sch
- Previous by thread: Re: Query help !
- Next by thread: Having a stored procedure copy tables & also preserve indexing/sch
- Index(es):
Relevant Pages
|
|