$this->export_dependencies_array[$r]=array('inter_line'=>'fd.rowid');// To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r]=' FROM ('.MAIN_DB_PREFIX.'fichinter as f, '.MAIN_DB_PREFIX.'fichinterdet as fd, '.MAIN_DB_PREFIX.'societe as s)';
$this->export_sql_end[$r].=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_fichinter';
$this->export_sql_end[$r]=' FROM '.MAIN_DB_PREFIX.'fichinter as f';
$this->export_sql_end[$r].=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON f.fk_projet = pj.rowid';
$this->export_sql_end[$r].=' LEFT JOIN '.MAIN_DB_PREFIX.'fichinterdet as fd ON f.rowid = fd.fk_fichinter,';
$this->export_sql_end[$r].=' '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r].=' WHERE f.fk_soc = s.rowid';
$this->export_sql_end[$r].=' AND f.entity IN ('.getEntity('intervention',1).')';