[SQL] query; check for zero and floats

2006-03-31 Thread vince
I'm trying to do a simple query and I'm not sure how to get it to work:

SELECT SUM(x0 + y0 + z0) / SUM(x2 + y2) AS A1, SUM(x1 + y1 + z1) / SUM(x3 + y3)
AS A2
FROM test

Problems:

1. All variables are integers.  When it does the division, it returns an
integer, but I want a float.  (I've tried numerous things to no avail)

2. If SUM(x2 + y2) == 0; there is a divide by zero error.  How do I check and
pass on zeroes?

Thanks,
Vince.


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [SQL] problem with select where like ']'

2000-10-17 Thread Vince Vielhaber


http://www.postgresql.org/users-lounge/index.html  has most of them.
Actually it's under General Info from the user's lounge.

It was brought to my attention today that the list of archives was
incomplete so I'll be adding to it and adding another one (developer 
and user).  Don't get too attached to the url below, it will be going
away very soon.

Vince.

On Tue, 17 Oct 2000, Bruce Momjian wrote:

> The fact is, I can't figure out how to get there without the URL.
> 
> 
> > Joseph Shraibman <[EMAIL PROTECTED]> writes:
> > > WHAT mailing list archives?
> > > They aren't linked to anywhere on www.postgresql.org that I can find.
> > 
> > Hmm.  My bookmark is
> > 
> > http://www.postgresql.org/lists/mailing-list.html
> > 
> > Dunno how to get there from the site toplevel...
> > 
> > regards, tom lane
> > 
> 
> 
> 

-- 
==
Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
 128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
Online Campground Directoryhttp://www.camping-usa.com
   Online Giftshop Superstorehttp://www.cloudninegifts.com
==






Re: [HACKERS] Re: [SQL] PostgreSQL web page

2001-01-10 Thread Vince Vielhaber

On Tue, 9 Jan 2001, The Hermit Hacker wrote:

> On Tue, 9 Jan 2001, Kaare Rasmussen wrote:
>
> > I wonder why http://www.postgresql.org is not updated with news. The
> > latest "Latest News" is from Nov 16. I have to go to
> > http://www.pgsql.com to find some interesting news later than that:
> > 2000-12-22 PostgreSQL, Inc. Releases Open Source Replication & Database
> > and2000-12-12 2000 Linux Journal Editor's
> > Choice Award for Best Database
> >
> > In fact I was looking for the Replication server. No mention seems to be
> > available on postgresql.org.
> >
> > Also the mailing list archive for pgsql-sql is not listed here:
> > http://www.postgresql.org/devel-corner/index.html  - but you can see it
> > if you write the correct URL yourself.
>
> I have no graphical browser right now, and lynx isn't installed, so I'm a
> bit at a disadvantage here ... but, pgsql-sql *should* be listed under
> users-gallery, not devel ... devel is -hackers, -bugs, -ports, etc ...

Unless the clock on hub was wrong, I have the award happening on
11/16/Y2K.   The replication server info was a press release by
PostgreSQL, Inc.  Not the PostgreSQL Global Development Group.   Between
GB and PG,Inc with the constant barrage of press releases I made the
decision months ago that NO press releases from ANY group would be posted
on the PostgreSQL website - these groups have their own websites for that
and PostgreSQL.org doesn't need to be caught up in the middle.

pgsql-sql is in the users section - both info and archives.

> Beyond that, the web site is maintained by Vince ... but I thought the
> Award was definitely up there already ...

Both on the main page and in latest news.

Vince.
-- 
==
Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
 128K ISDN from $22.00/mo - 56K Dialup from $16.00/mo at Pop4 Networking
Online Campground Directoryhttp://www.camping-usa.com
   Online Giftshop Superstorehttp://www.cloudninegifts.com
==






[SQL] Re: [PHP-DB] Problem regarding 'select...as...'

2000-06-12 Thread Vince LaMonica

On 2000-06-12, Bernie Huang stated:

} "select equip_attr[1], equip_attr[2]
} as year, make
} from vehicle_tb;"
} 
} which gives me the following error:
} 
} "ERROR:  Attribute 'make' not found"
} 
} Is there something wrong with my "as" usage?  Thanks

Try: 
"select equip_attr[1] as year, equip_attr[2] as make"
instead.

HTH,

/vjl/