division by zero error in a request

From: Bernard Grosperrin <bernard(at)bgsoftfactory(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: division by zero error in a request
Date: 2006-10-18 17:43:16
Message-ID: wf3mczdcqge1.1vyz19vu3vvi9.dlg@40tude.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I wants to make a view giving me some statistics.

I am not sure to understand why something like this

SELECT location_id, (sold_parts_amount_dly + sold_labor_amount_dly) /
(sold_parts_amount_dly + sold_labor_amount_dly) from sales

give me a division by zero error?

If that is not the way to go, should I write a function that I would call
instead?

Thanks,
Bernard

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2006-10-18 18:04:17 Re: Maximum size of database
Previous Message Tom Lane 2006-10-18 17:41:00 Re: ERRORDATA_STACK_SIZE exceeded