Skip to content
Advertisement

Using WITH and subset in CASE construction

Greetings to senior colleagues. I got caught up in this thing. It is necessary to substitute the corresponding values in the CASE when the construction depending on the state of the load_date field. The problem is that the second was assigned a value to the mean_v field based on the calculation of the average mean_v obtained for the subsample. how to implement value acquisition and assignment in when then? I have been tried to create alias , with alias () as (), but sql throws syntax error near WITH. I have to assign an average value from the subset where the columns correspond to the current row for each row What the problem? Can I use WITH in CASE?

Advertisement

Answer

Maybe something like

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement