How to properly use variables in SQL queries?

I used to have:

 Select customer, count(*), now() as time
 From product_registry
 Group By customer
 ORDER BY COUNT(customer) DESC

I currently have:

Select customer, count(*), substring(model_number, 4, 6) as product_model, now() as time
From product_registry
WHERE product_model = ANY(${selected_product_model})
Group By customer
ORDER BY COUNT(customer) DESC

I have setup as a variable in grafana called selected_product_model but the above code is not working.

I want to filter my ordered customer values where substring(model_number, 4, 6) is equal to any of the selected strings the user chose when clicking through the selected_product_model options.

Separate from this, I am also unsure how I could display all selected variables in a single grafana table panel. I am new to Grafana and PostgreSQL so I was struggling to find any info on this on youtube/stack overflow/grafana community forums/grafana docs. If anyone could point me towards the code that does that or how I could learn it myself that would be great.

What is the field that hold the timestamp ?

Not entirely sure what is being asked, I don’t know why now() as time is included but it seems to work. The panel that contains this SQL query is a pie chart, but I want to use this filter on all my panels: graph, table, etc. So I figured if I solved it for just this one I could figure it out for the rest.