I need to implement an inner join on two tables order_header
and order_item
based on their ORDER_ID
. The equivalent SQL query:
SELECT * FROM order_header INNER JOIN order_item ON order_header.ORDER_ID=order_item.ORDER_ID
How to implement this in ydn-db?
Use
db.scan
for table joining. Currently YDN-DB does not have a nice wrapper for joining, but manual joining is not that difficult. Here is joining query forSELECT * FROM Supplier, Part WHERE Supplier.CITY = Part.CITY
.See more detail on Join query article.