Forum Discussion
Anonymous
6 years agoNot applicable
How to join two tables in direct query
Hello, I have two tables: The first tables shows my orders and products which were ordered with a quantity and the second table shows all my available products without quantity field. So I want to...
- 6 years agoTry this:
VAR __Table =
NATURALINNERJOIN(
'Products',
SELECTCOLUMNS(
'Orders',
"SKU",[SKU],
"Quantity",[Quantity]
)
)
Anonymous
6 years agoNot applicable
Greg_Deckler Thank you for your fast reply. So I tried to do a join but I get the error message "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value." On the picture I tried to describe what I want to create but is this even possible since the tables have different columns?
Greg_Deckler
Community Champion
6 years agoTry this:
VAR __Table =
NATURALINNERJOIN(
'Products',
SELECTCOLUMNS(
'Orders',
"SKU",[SKU],
"Quantity",[Quantity]
)
)
VAR __Table =
NATURALINNERJOIN(
'Products',
SELECTCOLUMNS(
'Orders',
"SKU",[SKU],
"Quantity",[Quantity]
)
)