I have a table with two columns, user ids and strings. I want to add a third column that counts the number of strings within the second column that start with the entire string value in any given row. There is only one row per user.
The goal is to get the following table structure:

Here the count is equal to the number of rows in the string column that start with the given value in that row. I've tried using count(string like string + '%') in combination with over(partition by string) but it doesn't seem to work how I had hoped.
Any help is appreciated (btw I'm using SQL on Redshift).