Hi,
Now its more of a sql question (but it works on postgresql) ..
We have our node names based on the customer and a uniq machine id. Now my problem is that I cannot group by on a substring
Now I have tried the following:
select sum(PHYSICAL_MB)/1024 as GB_in_Storagepool, substr(node_name,1,posstr(node_name,'-')-1) from OCCUPANCY where stgpool_name='TAPEPOOL' group by substr(node_name,1,posstr(node_name,'-')-1)
select sum(PHYSICAL_MB)/1024 as GB_in_Storagepool, substr(node_name,1,posstr(node_name,'-')-1) as xxx from OCCUPANCY where stgpool_name='TAPEPOOL' group by xxx
Normal group by is working fine but its the group by and substring/alias that does seem to work .. does anyone have a workaround for that ?
Now its more of a sql question (but it works on postgresql) ..
We have our node names based on the customer and a uniq machine id. Now my problem is that I cannot group by on a substring
Now I have tried the following:
select sum(PHYSICAL_MB)/1024 as GB_in_Storagepool, substr(node_name,1,posstr(node_name,'-')-1) from OCCUPANCY where stgpool_name='TAPEPOOL' group by substr(node_name,1,posstr(node_name,'-')-1)
select sum(PHYSICAL_MB)/1024 as GB_in_Storagepool, substr(node_name,1,posstr(node_name,'-')-1) as xxx from OCCUPANCY where stgpool_name='TAPEPOOL' group by xxx
Normal group by is working fine but its the group by and substring/alias that does seem to work .. does anyone have a workaround for that ?