I have a column in a table with words separated by comma. I need to count each occurence of each word My column looks like : (‘a, b, c’), (‘a, b, d’), (‘b, c, d’), (‘a’), (‘a, c’); (fiddle at the bottom) Here is what I get : But here is what I expect Here is what I’ve done so
Tag: cross-apply
Dynamic SQL to Unpivot Data using Cross Apply with Multiple Columns
Microsoft SQL Server Management Studio v18.8 I have a table that will have varying columns and column names. I need to unpivot the data so I can then eventually store it into a different table. Unfortunately, this is the process since the original table is being pulled from a Google Sheet. I looked up several articles and answers on here,
SQL query to unpivot and union for multiple column
I’m trying to achieve the following result… input, table A I would obtain this output I’m trying to use cross apply and I can create the column “month_year” but I don’t know how to merge “values” in the last column. Thanks for help! Answer I think this is basically apply: