Hello Stackoverflow i am facing problem in join records from master and detail table using Sql Query
Master Table is Represented By Following Data
I Have Data in Detail Table
What I need in output is
What i tried is
I need sql select query to get the result shown above
SELECT distinct(master.voucherkey), detail.Amount FROM master ,detail
where master.voucherkey = detail.voucherkey
ie repeated voucherkey once and unique record many time thanks
You need to join the tables together rather than trying to select from both:
SELECT master.voucherkey, detail.Amount
FROM master
LEFT JOIN detail
ON master.voucherkey = detail.voucherkey
SQL cannot return merged rows like the picture.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.