vishal veerkar wrote:
> On Fri, Dec 18, 2009 at 5:13 PM, Mike Holden <
bacula AT mikeholden DOT org> wrote:
>
>> vishal veerkar wrote:
>> > After trying some combination with other queries finally i got the break
>> > through...below query gives the output for All clients utilization in GB
>> for
>> > specified time window...this may helpful for others
>> >
>> > :List storage used by client and pool after specified time window
>> > *Enter Start time in YYYY-MM-DD HH:MM:SS format:
>> > *Enter End time in YYYY-MM-DD HH:MM:SS format:
>> > SELECT Client.Name AS Client, Pool.Name as Pool,
>> > sum(Job.JobFiles) as Files, sum(Job.JobBytes)/(1024*1024*1024) as
>> > TotalSizeGb
>> > FROM Client, Job, Pool
>> > WHERE Job.ClientID = Client.ClientID and Job.PoolID = Pool.PoolID
>> > AND JobStatus='T'
>> > AND Job.StartTime >= '%1'
>> > AND Job.StartTime <= '%2'
>> > GROUP by Client.ClientID
>> > ORDER by Client.Name;
>>
>> You still have Pool.Name listed in the SELECT list but not in the GROUP BY
>> clause. I
>> would suggest (to give standard SQL code), that you change the "GROUP BY
>> clause to
>> "GROUP BY Client.Name, Pool.Name". You might want to update the ORDER BY in
>> the same
>> way.
> Hi,
>
> Actually i am not a SQL expert and hence if somebody would help me modifying
> the query for getting the result it would be greatly helpful.
>
> Regards,
>
> Vishal Veerkar
>