RE: [SQLDownUnder] CASE STATEMENT


    [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
    • From: anthony
    • Subject: RE: [SQLDownUnder] CASE STATEMENT
    • Date: Thu, 10 Mar 2005 13:27:14 +1100

    thanks...so i cannot put a SQL statement under each when?

    From: SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx [mailto:SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Victor.Isakov@xxxxxxxxxxxxxxxxxxxx
    Sent: Thursday, 10 March 2005 1:40 PM
    To: SQLDownUnder@xxxxxxxxxxxxxxxxxxxxxx
    Subject: RE: [SQLDownUnder] CASE STATEMENT

    To be a little picky, sorry Peter, I would recommend avoiding = for Column Headings as it ain't ANSI, so:   SELECT  CASE WHEN BankBalance > 0 THEN 'Rich' WHEN BankBalance = 0 THEN 'Neutral ELSE 'Broke' END AS MyFinancialPosition ......

    From: SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx [mailto:SQLDownUnderList@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Peter Busch, Altosoft
    Sent: Thursday,10 March 2005 1:36 PM
    To: SQLDownUnder@xxxxxxxxxxxxxxxxxxxxxx
    Subject: Re: [SQLDownUnder] CASE STATEMENT

        SELECT MyFinancialPosition = CASE WHEN BankBalance > 0 THEN 'Rich' WHEN BankBalance = 0 THEN 'Neutral ELSE 'Broke' END ......   or   SELECT MyFinancialPosition = CASE BankBalance WHEN > 0 THEN 'Rich' WHEN = 0 THEN 'Neutral ELSE 'Broke' END .....            
    ----- Original Message ----- From: anthony To: sqldownunder@xxxxxxxxxxxxxxxxxxxxxx Sent: Thursday, March 10, 2005 12:28 PM Subject: [SQLDownUnder] CASE STATEMENT
    How do i create a CASE statement in SQL with the same functionaility as this   select case Type case 1         ....some code case 2     .......some code end select   AnthonySto unsubscribe to this list, please send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by http://www.readify.net
    to unsubscribe to this list, please send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by http://www.readify.net

    This message and any attachment is confidential and may be privileged or otherwise protected from disclosure. If you have received it by mistake please let us know by reply and then delete it from your system; you should not copy the message or disclose its contents to anyone.

    ==============================================================================

    to unsubscribe to this list, please send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by http://www.readify.net to unsubscribe to this list, please send a message back to the list with 'unsubscribe' as the subject. Powered by mailenable.com - List managed by http://www.readify.net



    (Click here for more information on the sqldownunder mailling list)