I am confused whether at-sign variables could ever work in MonetDB. Is it standard SQL or only mySQL? (See e.g. this answer here on SO.) MonetDB claims to support SQL:2003 (full feature list here, hard for me to parse), but this is what they say on variables.
The following line fails in MonetDB complaining about the unexpected symbol :
. But is there a way to get this work? I see no way to combine a SET
(after DECLARE
) with SELECT
.
SELECT @firstq := QUANTILE(share26_2007,0.25) FROM sys.share26_2007;
(Afterwards, the following is the intended use case:)
SELECT peorglopnr, CASE WHEN share26_2007 < @firstq THEN 1