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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -