Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.
SELECT ProspectID, Prospect, ContEnd_Switch, TargetPrice, SUM(MwhAct * Total) / SUM(MwhAct) AS WAverage, GM_MarRate, Comm_1_Rate, Comm_2_Rate, Comm_3_Rate, Comm_4_Rate, Comm_5_Rate, Comm_6_Rate FROM Prospect_Cogs WHERE (Fwd_Mth BETWEEN 1 AND 12) and SRID = 176 and (Realtime in (select Realtime from tbl_realtime) ) GROUP BY ProspectID, Prospect, TargetPrice, ContEnd_Switch, GM_MarRate, Comm_1_Rate, Comm_2_Rate, Comm_3_Rate, Comm_4_Rate, Comm_5_Rate, Comm_6_Rate having SUM(MwhAct * Total) / SUM(MwhAct) > 0 order by CASE 0 when 1 then cast(ContEnd_Switch as varchar) -- by end contract when 2 then cast(TargetPrice as varchar) -- Target Price when 3 then cast(SUM(MwhAct * Total) / SUM(MwhAct) as varchar) --by quoted Price else Prospect --by Prospect Name END
|Following an example - removing duplicate strings||4||67|
|Help with simplifying SQL||6||54|
|LAG_ROWID - how do I get the right order using this query?||2||22|
|What is this datetime?||1||25|