Skip to Content.
Sympa Menu

internetworkers - Re: [internetworkers] SQL Help?

internetworkers AT lists.ibiblio.org

Subject: Internetworkers: http://www.ibiblio.org/internetworkers/

List archive

Chronological Thread  
  • From: Scott Russell <catfather AT donpoo.net>
  • To: "Internetworkers: http://www.ibiblio.org/internetworkers/" <internetworkers AT lists.ibiblio.org>
  • Subject: Re: [internetworkers] SQL Help?
  • Date: Mon, 25 Feb 2008 22:22:34 -0500


On Mon, 2008-02-25 at 18:47 -0500, Scott Russell wrote:
> On Mon, 2008-02-25 at 16:41 -0500, Ilan Volow wrote:
> > I'm a PostgreSQL guy, so take my educated guess with a grain of salt,
> > but you might want to try this just to see if it works:
>
> Much appreciated. I'll take a look at it...
>

FYI, You're suggestion worked fine. I'm not entirely convinced I'm doing
this sanely still, but it does work.

I also do this to calculate a read_size column which has the formula of
(read_bytes/read_ops = read_size). Note that read_ops could be 0 which
would yield a NULL in the read_size column. To avoid that, I use a
nested IF!

IF(SUM(IF(latx_stats_data.statname = 'read_ops', `statval`, 0)),
(SUM(IF(latx_stats_data.statname = 'read_data', `statval`, 0)) /
SUM(IF(latx_stats_data.statname = 'read_ops', `statval`, 0))), 0) AS
'read_size'

I have to do this with several columns. I wonder if should read up on
stored procedures...

--
Scott <catfather AT donpoo.net>
AIM: BlueCame1





Archive powered by MHonArc 2.6.24.

Top of Page