Re: [NF-Sorta] O! for want of a cursor! (SQL question)

2009-01-30 Thread Ricardo Aráoz
Ken Kixmoeller/fh wrote: >> Select >> Case ColumnOrVariable >> when ThisCondition then ThisValue >> when ThatCondition then ThatValue >> etc. end as MyOutput >> > > > Yes, that is what I was working on. Here is what I have so far: > > CASE > WHEN length(address2)=0 AND length(mailcode)=0 THE

Re: [NF-Sorta] O! for want of a cursor! (SQL question)

2009-01-27 Thread Ken Kixmoeller/fh
On Jan 27, 2009, at 8:56 AM, Stephen Russell wrote: > This statement is just getting one column for your export right? Right > Take your last when as the else statement before your END. I don't see the logic. I am not saying you are wrong! I am really saying *I* don't see the logic. Besides,

Re: [NF-Sorta] O! for want of a cursor! (SQL question)

2009-01-27 Thread Stephen Russell
On Tue, Jan 27, 2009 at 5:35 AM, Ken Kixmoeller/fh wrote: >> >> Select >> Case ColumnOrVariable >> when ThisCondition then ThisValue >> when ThatCondition then ThatValue >> etc. end as MyOutput > > > Yes, that is what I was working on. Here is what I have so far: > > CASE > WHEN length(address2)=

Re: [NF-Sorta] O! for want of a cursor! (SQL question)

2009-01-27 Thread Ken Kixmoeller/fh
> > Select > Case ColumnOrVariable > when ThisCondition then ThisValue > when ThatCondition then ThatValue > etc. end as MyOutput Yes, that is what I was working on. Here is what I have so far: CASE WHEN length(address2)=0 AND length(mailcode)=0 THEN address1 WHEN length(address2)=0 AND leng

Re: [NF-Sorta] O! for want of a cursor! (SQL question)

2009-01-26 Thread Stephen Russell
On Mon, Jan 26, 2009 at 5:34 PM, Kenneth Kixmoeller wrote: > OK, I'm working on this in a SQL statement (MySQL): > > Have 3 fields from 2 tables which need to be combined to make up a > single field address field in an export file. The three fields are: > - location.address1 > - location.address2

Re: [NF-Sorta] O! for want of a cursor! (SQL question)

2009-01-26 Thread Richard Quilhot
Don't know if this applies, but look into NVL function. Richard E. Quilhot C.N.A. quilh...@gmail.com Robert Benchley - "Drawing on my fine command of the English language, I said nothing." On Mon, Jan 26, 2009 at 6:34 PM, Kenneth Kixmoeller < ken.kixmoel...@information-architecture.com> wrote:

[NF-Sorta] O! for want of a cursor! (SQL question)

2009-01-26 Thread Kenneth Kixmoeller
OK, I'm working on this in a SQL statement (MySQL): Have 3 fields from 2 tables which need to be combined to make up a single field address field in an export file. The three fields are: - location.address1 - location.address2 - person_location.mailcode The mail_code belongs to the instance of