Re: Re: [NF] MySQL IFNULL() Question (Ken Dibble)

2007-03-07 Thread Mike yearwood
7. Re: [NF] MySQL IFNULL() Question (Ken Dibble) Yeah. The idea is to have People in the system only once, since the same person can be an Artist (designated as such for a Performance, like when you go to see Bonnie Raitt--she's got a Band too, but it's not The Bonnie Raitt Band, it's just

Re: Re: [NF] MySQL IFNULL() Question (Ken Dibble)

2007-03-07 Thread Ken Dibble
Do any of these help? http://www.databaseanswers.org/data_models/ There's certainly a lot of food for thought there. Thanks very much! Ken www.stic-cil.org -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.7/713 - Release

Re: [NF] MySQL IFNULL() Question

2007-03-07 Thread Ken Dibble
Similar to the directory problem, sometimes you need to convert a type of data into a more abstract element. Well, that's what I thought I was doing with my compound key of arttype and artid. They behave as though there is a coordinates table, except that table doesn't really exist.

Re: MySQL IFNULL() Question

2007-03-06 Thread MB Software Solutions
Derek Kalweit wrote: Try TEXT TO artfield TEXTMERGE NOSHOW PRETEXT 2 The PRETEXT value was added to trim out the leading spaces or tabs(2=tabs) which will make the string look good in code(properly indented), but be compact when you send it to the server. And thus will be better because

Re: MySQL IFNULL() Question

2007-03-06 Thread Derek Kalweit
Try TEXT TO artfield TEXTMERGE NOSHOW PRETEXT 2 The PRETEXT value was added to trim out the leading spaces or tabs(2=tabs) which will make the string look good in code(properly indented), but be compact when you send it to the server. And thus will be better because it's not as many

Re: [NF] MySQL IFNULL() Question

2007-03-06 Thread Ken Dibble
It returns actual values for artist that my query returned as null. Can you tell me why that is? The WHERE clause for each of the two selects filters out only those records that match either Person or Band so you're not getting any extra records with NULLs. Right. But (he said sheepishly)

Re: [NF] MySQL IFNULL() Question

2007-03-06 Thread Ted Roche
On 3/6/07, Ken Dibble [EMAIL PROTECTED] wrote: Right. But (he said sheepishly) my tables had actual data in them that should have been returned in the artist field for some performances; instead my query returned nulls in some cases. No need to be sheepish. This stuff is hard. I suspect you

Re: [NF] MySQL IFNULL() Question

2007-03-06 Thread Ken Dibble
At 03:57 PM 3/6/07, you wrote: On 3/6/07, Ken Dibble [EMAIL PROTECTED] wrote: I suspect you have a subtle data design problem, one iirc Tamar once presented as parents of unrelated siblings - your Perfs table has an id that you are joining both to a PK in the Person table and a PK in the

Re: [NF] MySQL IFNULL() Question

2007-03-06 Thread Whil Hentzen (Pro*)
Yeah. The idea is to have People in the system only once, since the same person can be an Artist (designated as such for a Performance, like when you go to see Bonnie Raitt--she's got a Band too, but it's not The Bonnie snip This sounds like a great problem for a database design class.

Re: [NF] MySQL IFNULL() Question

2007-03-05 Thread Ted Roche
On 3/4/07, Ken Dibble [EMAIL PROTECTED] wrote: I'm trying to substitute an empty string when a derived field returns None (null). Any suggestions would be appreciated. Thanks. You might not like my suggestion ;). If I understand what you're doing, you're trying to assemble a list of records

Re: MySQL IFNULL() Question

2007-03-05 Thread Mike yearwood
Hi Ken I like Ted Roche's approach, but have you tried CAST()? BTW, here's a way to make your query more readable which may help you with future queries. TEXT TO artfield TEXTMERGE NOSHOW (SELECT ICASE(musPerfs.arttype == P, ALLTRIM(musPeople.firstname) + +

Re: [NF] MySQL IFNULL() Question

2007-03-05 Thread Ken Dibble
I'm trying to substitute an empty string when a derived field returns None (null). Any suggestions would be appreciated. Thanks. You might not like my suggestion ;). If I understand what you're doing, you're trying to assemble a list of records and the performer from the Songs and Perfs

Re: [NF] MySQL IFNULL() Question

2007-03-05 Thread Ken Dibble
Actually, I like it a lot. It returns actual values for artist that my query returned as null. Can you tell me why that is? (I know it's not the field truncating thing; I modified my original query with a PADL() and still got those nulls.) I meant, PADR(). -- No virus found in this outgoing

Re: MySQL IFNULL() Question

2007-03-05 Thread Ken Dibble
I like Ted Roche's approach, but have you tried CAST()? I hadn't. Ted's query runs faster than mine, though, and, apparently, it's more accurate (returns actual values for artist in places where my query returned nulls). I don't know why that is, though, and I also don't know why, separate

[NF] MySQL IFNULL() Question

2007-03-04 Thread Ken Dibble
I'm trying to substitute an empty string when a derived field returns None (null). In VFP 9 I can do it like this: artfield = '(SELECT ICASE(musPerfs.arttype == P, ' ; + 'ALLTRIM(musPeople.firstname) + + ALLTRIM(musPeople.lastname), ' ; + 'musPerfs.arttype == B, '