How to use a single-valued variable as an input for other variable with type Query and DataSource as MSSQL?

I have a variable(suppose temp) which is a single valued.
My requirement is to use temp value in other variable(suppose temp2) of type Query and DataSource Microsoft SQL server.
I tried customizing the query using $ sign like below:
select distinct Platform from dbo.MobileCenterHealthCheck where Platform = $temp

but it gives the error Templating-Template variables could not be initialized: mssql: Incorrect syntax near ‘=’.

Request you to please provide your valuable suggestions.