Type mismatch problem

From: Michael Rowan <mike(dot)rowan(at)internode(dot)on(dot)net>
To: pgsql-novice novice <pgsql-novice(at)postgresql(dot)org>
Subject: Type mismatch problem
Date: 2012-02-06 09:52:39
Message-ID: 563BB114-63E9-485C-B999-6BCE9224636B@internode.on.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

As a total beginner who has for decades used an application that would allow type mismatches like boolean*numeric I tried the following select:

SELECT sum(cost*quantity)*(sales_type=1) AS sales_type1, sum(cost*quantity)*(sales_type=2) AS sales_type2 FROM etc etc

In the above, cost and quantity are TYPE numeric(9,2), sales_type is smallint.

PostgreSQL does not allow numeric*boolean. The error message ends with "You might need t" which kinda leaves me hanging.

Any clues would be most welcome.

Michael Rowan
mike(dot)rowan(at)internode(dot)on(dot)net

11 Kingscote Street
ALBERTON
South Australia 5014

tel 618 8240 3993

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Philip Couling 2012-02-06 10:22:03 Re: Type mismatch problem
Previous Message Tom Lane 2012-02-05 23:08:07 Re: error on start up "could not change directory to"