Hi,

I have a special case where one table (t1) has 0:1 relationships with two 
other semi-identical tabes (t1.linkt2 to t2 table, t1.linkt3 to t3 table), 
and I need to generate a list of all t1 rows with some fields from t2 & t3.

I'm using the "left" select var which works ok.

   db().select(
      t1.id, t2.name, t3.name,
      left=[ t2.on( t1.linkt2==t2.id ), t3.on( t1.linkt3==t3.id ) ],
      orderby=t2.name|t3.name
   )

But my problem is that I need to order the rows (in the query, not in the 
actual rows result) by the common field "name" in tables t2 & t3, but as if 
they were concatenated.

Currently I get all rows first ordered by t2.name and then all rows ordered 
by t3.name afterwards (i.e. two orderby groups), which is not what I need.

I need to somehow "concatenate" t2.name and t3.name and order by that 
concatenation.

My real situation is more complex but I tried to simplify as much as I 
could, I hope I explained clearly.

Is this possible?, how?.

Thanks!,

   Carlos

Reply via email to