[SQL] Anual Query

2005-11-28 Thread Mauricio Fernandez A.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, Can any of you help me with this query?, I need to retrieve the sum(units) and sum(cost) for each client in every month in the same row, something like this: client|UnJan|CostJan|UnFeb|CostFeb|UnMar|CostMar ...|UnDec|CostDec - -

Re: [SQL] Anual Query

2005-11-28 Thread Frank Bax
At 11:20 AM 11/28/05, Mauricio Fernandez A. wrote: Can any of you help me with this query?, I need to retrieve the sum(units) and sum(cost) for each client in every month in the same row, something like this: client|UnJan|CostJan|UnFeb|CostFeb|UnMar|CostMar ...|UnDec|CostDec - -

[SQL] DEFAULT Constraint based on table type?

2005-11-28 Thread Announce
Lets say I have the following tables. CREATE TABLE animals(id primary key, name varchar, type varchar); CREATE TABLE dogs (breed varchar)INHERITS (animals); CREATE TABLE birds (bool hasFeathers) INHERITS (animals); Is there a way I can specify a default on the child table that will po

Re: [SQL] DEFAULT Constraint based on table type?

2005-11-28 Thread Jaime Casanova
On 11/28/05, Announce <[EMAIL PROTECTED]> wrote: > Lets say I have the following tables. > > CREATE TABLE animals(id primary key, name varchar, type varchar); > CREATE TABLE dogs (breed varchar)INHERITS (animals); > CREATE TABLE birds (bool hasFeathers) INHERITS (animals); > > Is there

Re: [SQL] DEFAULT Constraint based on table type?

2005-11-28 Thread Rod Taylor
On Mon, 2005-11-28 at 14:22 -0600, Announce wrote: > Lets say I have the following tables. > > CREATE TABLE animals(id primary key, name varchar, type varchar); > CREATE TABLE dogs (breed varchar)INHERITS (animals); > CREATE TABLE birds (bool hasFeathers) INHERITS (animals); r=# alter

Re: [SQL] join if all matches

2005-11-28 Thread Bruno Wolff III
On Tue, Nov 22, 2005 at 10:30:17 +0200, Sim Zacks <[EMAIL PROTECTED]> wrote: > I am trying to figure out an sql statement and I was hoping someone could > help. I'm having brainfreeze right now. > > Table Rules > RuleID > RuleName > > Table RuleAgents > RuleAgentID > RuleID >