* 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
> > 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
* 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.
> > 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
> 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
> 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
* 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
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
* 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
> 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
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
I have this table:
CREATE TABLE texts (
textid mediumint(9) NOT NULL auto_increment,
languageid char(2) NOT NULL default 'da',
textkey varchar(32) NOT NULL default '',
textvalue text NOT NULL,
PRIMARY KEY (textid),
)
It could contain these data:
(textid,languageid,textkey,textvalue)
1
12 matches
Mail list logo