SQL Question

From: Matthew <matt(at)ctlno(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: SQL Question
Date: 2001-03-08 18:36:22
Message-ID: 183FA749499ED311B6550000F87E206C1FD049@srv.ctlno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm trying to do some type of conditional select statement and I have no
idea how.

What I would like is something like this (using pseudo sql)

select (if(col1>1) true else if (col1<= 1) false) from foo;

does that make sense? Basically I want one column of my result set to be
true or false based on some logic. I can do it in code and have my program
handle it, but I was hoping to do it in SQL.

Thanks,

Matt O'Connor

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Roderick A. Anderson 2001-03-08 19:29:53 Re: Update through views?
Previous Message Timothy H. Keitt 2001-03-08 18:00:05 Re: Data types?