I need variable in parametrized view.
CREATE VIEW my_new_view AS
SELECT
CampaignName,
sentiment, -- **CASE WHEN variable** = sentiment THEN sentiment ELSE NULL END AS sentiment_match
COUNT(CASE WHEN HOUR(StartTime) BETWEEN 23 AND 23 THEN sentiment ELSE NULL END) AS `23:00`
FROM call_details
WHERE voc.call_details.sentiment IN (
SELECT voc.call_details.sentiment
FROM voc.call_details
WHERE voc.call_details.sentiment = {sentiment:String}
)
GROUP BY CampaignName, sentiment --**in select if sentiment is there add sentiment in group also else dont add**
ORDER BY CampaignName,sentiment ASC;
need variable to store sentiment. is it possible in clikchouse, in mysql we can do by using stored procedure. in clickhouse how to do ?