mysql query not working -
i working on query joins several tables.here's code. query works fine until time add third line sum(saleitems_t.qtymajor) sales. error message says unknown column 'saleitems_t.qtymajor' in 'field list' trying build reorder worksheet.help appreciated.
select productmaster_t.productname_vc pgroup, stockmain_t.itemdescription item, sum(saleitems_t.qtymajor) sales, stockbuffers_t.buffer_qty bufferqty, (stkbalance_t.aj1+stkbalance_t.ar2+stkbalance_t.ad3+stkbalance_t.dx4) stock, (stkbalance_t.aj1+stkbalance_t.ar2+stkbalance_t.ad3+stkbalance_t.dx4)-stockbuffers_t.buffer_qty result productmaster_t, stockmain_t, stockbuffers_t, stkbalance_t stockmain_t.itemcode = stockbuffers_t.itemcode , stockmain_t.itemcode = stkbalance_t.itemid , productmaster_t.productid = stockmain_t.prodid , saleitems_t.itemid = stockmain_t.itemcode order productname_vc,itemdescription asc
you haven't referenced saleitems_t table in query, either in clause, or through join.
Comments
Post a Comment