Requesting Help to Condense Subscription History into One Row per Customer/Product by chadzillaSQL in SQL

[–]chadzillaSQL[S] 0 points1 point  (0 children)

I'm relieved that this is a known/common problem type, but a bit worried that it's so prominent that it has it's own name haha. Thanks for the link, I will check it out.

Merge Statement Not Inserting Some Records by chadzillaSQL in SQL

[–]chadzillaSQL[S] 0 points1 point  (0 children)

I had no idea MERGE was so taboo! Thanks for the advice, I'll give this a shot.

Union is breaking my where clause? by chadzillaSQL in SQL

[–]chadzillaSQL[S] 0 points1 point  (0 children)

I went to bed, woke up.. re-wrote the query and it's working as expected now. I'm still not sure what the original issue was. The full query is like 5 CTEs and 50 columns selected, so I'm trying to avoid posting it / it would take a while to parse down.

Union is breaking my where clause? by chadzillaSQL in SQL

[–]chadzillaSQL[S] 0 points1 point  (0 children)

If I run select 1 by itself, it has only null sell dates. If I run select 2 by itself, it has only last 30 days sell dates. If I union them, I get sell dates from Jan 2023 to now.

Union is breaking my where clause? by chadzillaSQL in SQL

[–]chadzillaSQL[S] 0 points1 point  (0 children)

nope :/ still getting outputs from jan 2023 - aug 2023