timestamp - PLSQL-Parametric definition of group function -


i have table want apply aggregation functions having criteria grouping of spesific element of specific column. assume example below:

timestamp   site    value  10:00             100 10:00            b  50 10:00            c  25 10:00            d  25 10:05             25 10:05            b  15 10:05            c  5 10:05            d  10 

i want find average value grouping site, timestamp site a,b want estimated one, meaning wanted replace b a have , find average:

timestamp   site    value 10:00             75 10:00             75 10:00            c  25 10:00            d  25 10:05             20 10:05             20 10:05            c  5 10:05            d  10 

one way update table setting b=a, not such sophisticated solution if want in future group more sites

you don't need update table.

select case site when 'b' 'a' else site end site       ,timestamp       ,avg(value) sites group case site when 'b' 'a' else site end         ,timestamp ; 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -