On 8/29/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I know this is a bit off topic, but I developing an app in CF accessing an 
> Oracle DB and I need my query to return the results in the format of 'yes' or 
> 'no' for 1 or 0 respectively.  Anyone know how I can do this within the SQL 
> select statement?
> 

SELECT
  CASE WHEN (myColumn = 1) THEN 'yes' ELSE 'no' END AS yesNoColumn
FROM
  myTable;

That works on Oracle 9i and up. For Oracle 8i and below, check out the
DECODE() function. It's extremely similar, though Oracle doesn't
recommend using it anymore from 9i forward.

Regards,
Dave.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:216691
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to