Forum Discussion
table expression
Hi Kelly, I am not sure that you noticed my point or not. I am saying in the final code in “Days since last purchase”, NATURALLEFTOUTERJOIN distinguished that Sales table and LastPrchase table (created by GROUPBY) have columns with identical header names (Customer column and Purchase Date column) , so that the output has customer and Purchase Date columns.
But when I cut the last part of the code (cut NATURALLEFTOUTERJOIN) as you see in the “Purchase_step2” table , the output has not columns with header Customer and Purchase Date name. I did not change anything in GROUPBY function but the out put has columns “sales_customer” and “sales_purchase date” not “Customer” and “Purchase Date” columns.
Best Regards
Hi koorosh ,
I know,if I comment out part of your expression,I get the troubling result as you say:
Based on my experience,if you use a table as a variable to get another table,it will be affected by context.
As we cant to query the internal mechanism of the function,I cant tell whether it is a bug,that's why I show you another method to get the result you need.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!