SELECT field on joined tables gives unexpected undefined #1985
Open
Description
Repro steps
const users = [{UserId: '1', UserName: 'User'}]
const orders = [{UserId: '1', Text: 'Order text'}]
const expected = alasql(`
SELECT *
FROM ? u
JOIN ? o
ON u.UserId = o.UserId`,
[users, orders])
const unexpected = alasql(`
SELECT UserName,Text
FROM ? u
JOIN ? o
ON u.UserId = o.UserId`,
[users, orders])
console.log({expected, unexpected});
// {
// expected: [{
// Text: "Order text", <- "Text" field is there ...
// UserId: "1",
// UserName: "User"
// }],
// unexpected: [{
// Text: undefined, <- ... but it is undefined when selected
// UserName: "User"
// }]
// }