php - Combine two different tables -
i have 3 tables. 1 contains details of items, second contains selling details , third 1 contains purchase details. want create query displays ledger type result. have tried following query giving warning like: current selection not contain unique column.
the result table contain column identify table picking values. like, put "p"
purchase , "s"
sale.
i have searched not able find solution in case. here query:
select date, itemcode, qty, billno, price, "p" sp purchase itemcode = 1007 union select date, itemcode, qty, billno, rate, "s" billing itemcode = 1007 order date asc
select date, itemcode, qty, billno, price, null rate, "p" sp purchase itemcode = 1007 union select date, itemcode, qty, billno, null price, rate, "s" sp billing itemcode = 1007 order date asc
Comments
Post a Comment