Changing Join Query

Fabian Eschrich info at faesch.de
Mon Oct 22 03:00:39 CDT 2007


Hi,

as I wrote in another message before, I am converting my app from mysql to
valentina.

Until today I used a join query to load records from my address table and
multiple records for each from a communication table (which holds
fonnumbers, fax, mail and so on).

select addresses.id,addresses.name1,addresses.name2,

CONCAT(commfon.value1,'-',commfon.value2,'-',commfon.value3) as fon,
CONCAT(commfax.value1,'-',commfax.value2,'-',commfax.value3) as fax,
commmail.value1 as mail from addresses

LEFT OUTER JOIN communication AS commfon ON commfon.type = 'fon' AND
commfon.record = addresses.id
LEFT OUTER JOIN communication AS commfax ON commfax.type = 'fax' AND
commfax.record = addresses.id
LEFT OUTER JOIN communication AS commmail ON commmail.type = 'mail' AND
commmail.record = addresses.id


This is not working on valentine. I think because of the alias name for the
join table.

So I tried to change it to subqueries, but I don't exactly know how to do
this. Can somebody help me please?


Thank you very much.

Mit freundlichen Grüßen / kindly regards,

Fabian Eschrich



More information about the Valentina mailing list