Re: OT: SQL function i know it exists

2002-03-21 Thread Sean Daniels

On 3/21/02 11:55 AM Tyler Clendenin wrote:

> say i have a table of users. and i want to select their gender, but the gender
> is stored as numbers 1 and 2 but i want to output them as M or F
> 
> SELECT FunctionIDontKnow(Gender, 1, 'M', 2, 'F') AS GenderAbbr
> FROM Users

In SQL 7 at least:

SELECT genderabbr = case when (gender = 1) then 'M' else 'F' end
>From users

- Sean

~~
Sean Daniels
  Director, Engineering
  Marketplace Technologies, Inc
(T): 207.363.7374
(C): 207.332.6340
(F): 240.269.6319
~~
  http://www.dealforce.com
  http://www.mergernetwork.com



__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: OT: SQL function i know it exists

2002-03-21 Thread Tyler Clendenin

doh, sorry.  msSQL

- Original Message -
From: "Jochem van Dieten" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, March 21, 2002 12:08 PM
Subject: Re: OT: SQL function i know it exists


> Tyler Clendenin wrote:
> > Help me please.  I am looking for the SQL function so that i can replace
values i am selecting with other values.  here is an example of how the
function works, if someone could just tell me the name.
>
> Case
> Decode
> ...
>
> What DBMS?
>
> Jochem
>
>
> 
__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: OT: SQL function i know it exists

2002-03-21 Thread Jochem van Dieten

Tyler Clendenin wrote:
> Help me please.  I am looking for the SQL function so that i can replace values i am 
>selecting with other values.  here is an example of how the function works, if 
>someone could just tell me the name.

Case
Decode
...

What DBMS?

Jochem


__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists