Combine os and osVersion filter options.

This commit is contained in:
Roberto Agostino Vitillo 2015-06-19 18:13:38 +01:00
Родитель 30504a90aa
Коммит f7f097166f
1 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -252,9 +252,16 @@ begin
into last_table_name
using prefix, '_' || channel || '%';
return query execute
E'select distinct dimensions->>\'' || filter || E'\'
from ' || last_table_name;
if (filter = 'os' or filter = 'osVersion') then
return query execute
E'select concat(t.os, \',\', t.version)
from (select distinct dimensions->>\'os\', dimensions->>\'osVersion\'
from ' || last_table_name || E') as t(os, version)';
else
return query execute
E'select distinct dimensions->>\'' || filter || E'\'
from ' || last_table_name;
end if;
end
$$ language plpgsql strict stable;