I want to get all the data from table partner_orders which I am. But in addition to that, I want to get the columns displayName
and email
from table ds_user.
ds_user id is the same as partner_orders dsUserId. So in the output in every array I want the email and displayName of that user with the same id to be added to the array.
However, with the way I have written the code below, I am getting all columns in partner_orders but I am not getting displayName and email added to it. What's the right way to do it
This is what I have written in JavaScript
async getAllParenFinanceOrders() {
const programOrders = await pool.query(
`SELECT po.*, du."displayName", du."email"
FROM partner_orders AS po
LEFT JOIN ds_user AS du ON du.id = po."dsUserId" `
);