mysql - How will I join these tables? -
i've got problem joining these tables; have code.
my query :
select partial a.{editransactiondetailid, ponumber}, partial b.{edi997detailid, nooftrans}, partial c.{editransactionid, senderid, receiverid, gsnumber, isanumber, filename}, partial d.{edidoctypeid, doctype} matrixedibundle:editransactiondetail join a.edi997details b join b.editransaction c join c.edidoctype d c.filename :filename , a.ponumber :ponumber , d.doctype = :doctype , a.flag = 1 , c.flag = 1
and got error :
join b.editransaction': error: class matrix\matrixedibundle\entity\editransactiondetail has no association named edi997details
how can join it?
you have not made relationship among tables, that's why got error here,
select table1.column1, table2.column2... table1 join table2 on table1.common_field = table2.common_field; // (this part missing in code)
for further study http://www.tutorialspoint.com/sql/sql-using-joins.htm
your code should this,
select a.edi_transaction_id, a.sender_id, a.receiver_id, a.gs_number, a.isa_number, a.file_name, b.edi_997_detail_id, b.no_of_trans, c.edi_transaction_etail_id, c.po_number, d.edi_doc_type_id, d.doc_type (((edi_transaction left join edi_997_details b on a.edi_transaction_id = b.edi_transaction_id) left join edi_transaction_details c on a.edi_transaction_id = c.edi_transaction_id) left join edi_doc_type d on a.edi_doc_type_id = d.edi_doc_type_id) a.file_name '%your file name%' , c.po_number '%your file name%' , d.doc_type = 'your doc type' , a.flag = 1 , c.flag = 1;
hope accomplish task.
Comments
Post a Comment