[TYPO3-dev] sql order by with left join

ries van Twisk typo3 at rvt.dds.nl
Mon Nov 5 16:47:44 CET 2007


hey Bas,

are you sure that the sorting field in the table  
tx_profalsosee_cat_mm  contains valid data?

I can hardly imagine that MySQL has a bug in that area.

If you do suspect it's a bug try this:

a) remove the LEFT from your joins and see if sorting get's corrected.
b) Setup your SELECT clause like this : SELECT mm.*, alsosee.*,  
cat.*,  alsosee.uid AS alsoseeuid

But I don't think it will change anything...

ries

On Nov 5, 2007, at 9:28 AM, Bas van der Togt wrote:

> Hello list,
>
> I'm trying to order a list in my extension but i can't get it work.
> The sql has a 'left join' and that must me the problem i think. Does
> anybody knows how to order my sql with a left join?
>
> SQL:
> SELECT alsosee.*, cat.*, mm.*, alsosee.uid AS alsoseeuid
> FROM tx_profalsosee_cat_mm AS mm
> LEFT JOIN tx_profalsosee_cat AS cat ON mm.uid_foreign=cat.uid
> LEFT JOIN tx_profalsosee_alsosee AS alsosee ON mm.uid_local=cat.uid
> WHERE alsosee.hidden=0 AND alsosee.deleted=0 AND alsosee.t3ver_state=0
> AND alsosee.pid IN ('.$pidList.')
> ORDER BY mm.sorting
>
> Kind regards,
> Bas










More information about the TYPO3-dev mailing list