Just getting my head around presto (and strange table structures) but assuming I have a table that stores data like this:
I'm looking to write a query to get the following as output:
I tried to get through this using below query:
SELECT DISTINCT
ts.id,
(SELECT
ts.trial_type,
ts.trial_score
FROM trial_scores ts
WHERE ts. = 12345678
AND ts.date = date_format(date_add('day', -3, CURRENT_DATE), '%Y-%m-%d')) as previous_score,
(SELECT
ts.trial_type,
ts.trial_score
FROM trial_scores ts
WHERE ts. = 12345678
AND ts.date = date_format(date_add('day', -2, CURRENT_DATE), '%Y-%m-%d')) as current_score
FROM trial_scores ts
However, I keep getting an Error from Query Engine "Multiple columns returned by subquery are not yet supported. Found 2"
Are there any other ways to re-write this query to get the desired output above?
Can confirm both my inner subqueries run on their own so I guess it's a case of mushing them together with everything else that I can't get my head around.