At 17:36 -0700 1/3/02, Mat Murdock wrote:
>Can you do something like this in Mysql?  The following lines are part of a
>much larger sql query that we use on a MSsql box.

MySQL has had CASE since earlier 3.23.x releases.

>
>...
>case ar_open_items.doc_code
>when 'I' then 'Invoice'
>when 'C' then 'Credit Memo'
>when 'D' then 'Debit Memo'
>when 'F' then 'Finance Chg'
>when 'O' then
>case ar_open_items.is_deposit
>when 'Y' then 'Deposit'
>when 'N' then 'On-Account'
>else 'D-Logic Error'
>end
>else 'Data Error'
>end as DOC_TYPE,
>...
>
>Thanks,
>
>Mat


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to