Plotting multiple curves with one query

Hello! I’ve been working with Grafana for about two weeks and I’m wondering if there is any way to get multiple curves out of one query?
The queries are against a MSSQL server containing stats about the wellbeing of our servers. What I have is something like the following:
bild
Where I query them individually as:

SELECT
value AS Temp,
$__time(timestamp)
FROM Metrics, Samples
WHERE id=counterId AND id=1337 AND $__unixEpochFilter(timestamp)

SELECT
value AS Temp,
$__time(timestamp)
FROM Metrics, Samples
WHERE id=counterId AND id=1338 AND $__unixEpochFilter(timestamp)

So what I would like to do is something like:

SELECT
value AS Temp,
$__time(timestamp)
FROM Metrics, Samples
WHERE id=counterId AND counterName=‘Temp C°’ AND $__unixEpochFilter(timestamp)

And then somehow split the result by their hostId and have different curves for them.This is so that if we add more servers in the future we don’t have to add new queries in Grafana.

Is something like this possible? And would a single alarm work for all of the curves?