RE: Is this possible with MySQL?

2001-12-27 Thread Roger Baklund
* Stig Nørgaard Jepsen > > Do you need to read _all_ textkeys for each page? How many different > > textkeys do you have in the table? > > No I don't have to read all the textkeys at once. They are > usually selected via a join from another table. And sometimes I > will read a set of rows via a se

Re: Is this possible with MySQL?

2001-12-27 Thread Stig Nørgaard Jepsen
> > I would emagine that only one 'left join' takes less processing power? > > Yes, but I don't think there is very much extra processing time involved > using one more join in most cases, as long as the join is indexed and the > index blocks involved are cached, or if the amount of data is reaso

RE: Is this possible with MySQL?

2001-12-26 Thread Roger Baklund
* Stig Nørgaard Jepsen > > select distinct > > t1.textkey, > > if(t2.textid,t2.languageid,t3.languageid) as languageid, > > if(t2.textid,t2.textid,t3.textid) as textid, > > if(t2.textid,t2.textvalue,t3.textvalue) as textvalue > > from texts t1 > > left join texts t2 on > > t2.textkey=t1.

Re: Is this possible with MySQL?

2001-12-23 Thread Stig Nørgaard Jepsen
> > Ok, I will, but I CC it to the mailinglist, maybe others have interest > > and/or comments. Besides, I think I may have found a bug... > > Yes, of course my fault not to post directly to the list :) > > I have another problem with this query. > If the textvalue field is the text type, then i

Re: Is this possible with MySQL?

2001-12-23 Thread Stig Nørgaard Jepsen
> select distinct > t1.textkey, > if(t2.textid,t2.languageid,t3.languageid) as languageid, > if(t2.textid,t2.textid,t3.textid) as textid, > if(t2.textid,t2.textvalue,t3.textvalue) as textvalue > from texts t1 > left join texts t2 on > t2.textkey=t1.textkey and > t2.languageid='da' > le

Re: Is this possible with MySQL?

2001-12-23 Thread Stig Nørgaard Jepsen
> Ok, I will, but I CC it to the mailinglist, maybe others have interest > and/or comments. Besides, I think I may have found a bug... Yes, of course my fault not to post directly to the list :) I have another problem with this query. If the textvalue field is the text type, then i get this erro

RE: Is this possible with MySQL?

2001-12-22 Thread Roger Baklund
* Stig Nørgaard Jepsen > It's a miracle! Thank you so much. I didn't think it was possible. > It seems to work alright. :) The LEFT JOIN and IF() combination is quite powerfull. > But i really don't understand what happens. > I would be very glad if you could explain for me what's the > princip

Re: Is this possible with MySQL?

2001-12-22 Thread Bogdan Stancescu
Stig Nørgaard Jepsen wrote: > > You may try this and see if it works (didn't test it, just jotted it down > > here): > > > > select t1.textid, t1.textid, t1.textvalue > I just don't understand why you did this? > Why select t1.textid twice? Ugh... That was a mistake -- I actually meant t1.textid

RE: Is this possible with MySQL?

2001-12-22 Thread Roger Baklund
* Stig Nørgaard Jepsen > Is it possible to make a query in MySQL, which could return row > 1,3 and 4 based on these conditions? select distinct t1.textkey, if(t2.textid,t2.languageid,t3.languageid) as languageid, if(t2.textid,t2.textid,t3.textid) as textid, if(t2.textid,t2.textvalue,t3.te

Re: Is this possible with MySQL?

2001-12-22 Thread Stig Nørgaard Jepsen
> You may try this and see if it works (didn't test it, just jotted it down > here): > > select t1.textid, t1.textid, t1.textvalue I just don't understand why you did this? Why select t1.textid twice? > from texts as t1, texts as t2 Again I don't understand this... Wouldn't t1 and t2 be the s

Re: Is this possible with MySQL?

2001-12-21 Thread Bogdan Stancescu
You may try this and see if it works (didn't test it, just jotted it down here): select t1.textid, t1.textid, t1.textvalue from texts as t1, texts as t2 where (t1.languageid='$Primlanguage' and t1.textid=t2.textid) or (t1.textid=t2.textid and t2.languageid='$Seclanguage' and t2.lan