oxid ce 4.4.8
i am using a the selectString function from oxarticlelist to generate a top 20 list.
my problem is that i can not use a custom result for articles, even if the the custom result columns are identical to the original from oxarticle table.
to get around this i tried to fetch my result from the original table, but i can add my sort things only by using left join and setting the row limit in the "outer" select.
this is too slow!!!
please help me!! :confused:
in following the tow examples (one working and one not working)
################################################## ###################
right join not working:
$sSelect = "select y.* from oxarticles y ";
$sSelect .= "right join (select g.oxid as oxid, sum(a.oxamount) as amount from oxorderarticles as a ... ... desc limit 20) x ON (x.oxid = y.oxid) ";
$sSelect .= "where y.oxparentid like '' ";
$sSelect .= "AND y.oxartnum not like 'di%' ";
$sSelect .= "AND y.oxissearch = 1 ";
$sSelect .= "order by x.amount desc ";
################################################## ###################
left join working, but need a lot of time:
$sSelect = "select y.* from oxarticles y ";
$sSelect .= "left join (select g.oxid as oxid, sum(a.oxamount) as amount from oxorderarticles as a ... ... desc) x ON (x.oxid = y.oxid) ";
$sSelect .= "where y.oxparentid like '' ";
$sSelect .= "AND y.oxartnum not like 'di%' ";
$sSelect .= "AND y.oxissearch = 1 ";
$sSelect .= "order by x.amount desc limit 20";
i am using a the selectString function from oxarticlelist to generate a top 20 list.
my problem is that i can not use a custom result for articles, even if the the custom result columns are identical to the original from oxarticle table.
to get around this i tried to fetch my result from the original table, but i can add my sort things only by using left join and setting the row limit in the "outer" select.
this is too slow!!!
please help me!! :confused:
in following the tow examples (one working and one not working)
################################################## ###################
right join not working:
$sSelect = "select y.* from oxarticles y ";
$sSelect .= "right join (select g.oxid as oxid, sum(a.oxamount) as amount from oxorderarticles as a ... ... desc limit 20) x ON (x.oxid = y.oxid) ";
$sSelect .= "where y.oxparentid like '' ";
$sSelect .= "AND y.oxartnum not like 'di%' ";
$sSelect .= "AND y.oxissearch = 1 ";
$sSelect .= "order by x.amount desc ";
################################################## ###################
left join working, but need a lot of time:
$sSelect = "select y.* from oxarticles y ";
$sSelect .= "left join (select g.oxid as oxid, sum(a.oxamount) as amount from oxorderarticles as a ... ... desc) x ON (x.oxid = y.oxid) ";
$sSelect .= "where y.oxparentid like '' ";
$sSelect .= "AND y.oxartnum not like 'di%' ";
$sSelect .= "AND y.oxissearch = 1 ";
$sSelect .= "order by x.amount desc limit 20";