sql question - Mailing list pgsql-general

From Travis Bauer
Subject sql question
Date
Msg-id Pine.GSO.4.21.0007121731170.21336-100000@mantaray.cs.indiana.edu
Whole thread Raw
In response to RE: The right direction for backups?  (James Hall <James.Hall@RadioShack.com>)
Responses Re: sql question
List pgsql-general
Let's say I have a table t1 with two fields, x and y.  How do I write an
sql statement like:

select x if y>1 else 0 from t1;

For every record in which y is > 1, you get x back.  Otherwise, you get 0
returned.

Thanks,
----------------------------------------------------------------
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
----------------------------------------------------------------


pgsql-general by date:

Previous
From: Scott Holmes
Date:
Subject: Triggers with arguments
Next
From: Tom Lane
Date:
Subject: Proposal for aggregate-function cleanups in 7.1