Bacula-users

Re: [Bacula-users] 7.2 mysql issue?

2015-10-07 14:26:42
Subject: Re: [Bacula-users] 7.2 mysql issue?
From: Ana Emília M. Arruda <emiliaarruda AT gmail DOT com>
To: Stephen Thompson <stephen AT seismo.berkeley DOT edu>
Date: Wed, 7 Oct 2015 15:21:56 -0300
Hello Stephen,

I cheked that "select count(distinct) is available in MySQL 5.X versions.

Could you try the bellow?

mysql> select count(distinct MediaId) from Media;
+-------------------------+
| count(distinct MediaId) |
+-------------------------+
|                      60 |
+-------------------------+
1 row in set (0.00 sec)

The complete query worked for me (the server has 22 clients):

mysql>  select Client.Name, count(distinct Filename.FilenameId) from Client, Filename, File, Job where Filename.FilenameId=File.FilenameId and File.JobId=Job.JobId and Job.ClientId=Client.ClientId group by Client.ClientId;
+------------------+-------------------------------------+
| Name             | count(distinct Filename.FilenameId) |
+------------------+-------------------------------------+
| xxxxxx-fd    |                                6590 |
| yyyyyy-fd         |                              222632 |
| zzzzzzz-fd         |                              441730 |
...
+------------------+-------------------------------------+
22 rows in set (16 min 42.63 sec)


Best regards,
Ana

On Wed, Oct 7, 2015 at 12:13 PM, Stephen Thompson <stephen AT seismo.berkeley DOT edu> wrote:


Thanks for the help.  Though, this is giving me a syntax error.

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '​​select Client.Name, count(distinct Filename.FilenameId) from Client, Filen' at line 1

On 10/7/15 6:23 AM, Ana Emília M. Arruda wrote:
​​select Client.Name, count(distinct Filename.FilenameId) from Client,
Filename, File, Job where Filename.FilenameId=File.FilenameId and
File.JobId=Job.JobId and Job.ClientId=Client.ClientId group by
Client.ClientId;

--
Stephen Thompson               Berkeley Seismological Laboratory
stephen AT seismo.berkeley DOT edu    215 McCone Hall #4760
Office: 510.664.9177           University of California, Berkeley
Remote: 510.214.6506 (Tue,Wed) Berkeley, CA 94720-4760

------------------------------------------------------------------------------
Full-scale, agent-less Infrastructure Monitoring from a single dashboard
Integrate with 40+ ManageEngine ITSM Solutions for complete visibility
Physical-Virtual-Cloud Infrastructure monitoring from one console
Real user monitoring with APM Insights and performance trend reports 
Learn More http://pubads.g.doubleclick.net/gampad/clk?id=247754911&iu=/4140
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>