I have a table in postgres that looks like this:
id score
1 23
2 4
3 42
4 21
In normal SQL I can declare a variable and assign it a value based on the result of a select statement:
declare @this_score int;
select @this_score = score from scores where id = 3;
print @test_int;
This outputs 42. Is it possible to assign a variable this way in postgres?