在SQL语句中插入一条数学公式。要详细的,急!
SQL语句如下
select a.controlcabinetcode, a.controlcabinetname, b.connectstatus, c.inputvoltage, c.outputvoltage, c.outputcurrent,
c.part ,
case b.connectstatus when '0' then '未连接' when '1' then '已连接' end connectstatusas,
c.workmode,
case c.workmode when '0' then '自动模式' when '1' then '旁路模式' when '2' then '外控旁路' when '3' then '用户模式'when '4' then '传动旁路' when '10' then '遥控节电' when '11' then '遥控旁路' end workmodeas,
c.alarmstatus,
case c.alarmstatus when '0' then '未报警' when '1' then '传动旁路' when '3' then '电压过大旁路' end alarmstatusas,
c.selfcheck,
case c.selfcheck when '0' then '关' when '1' then '开' end selfcheckas
from dbo.t_ControlCabinet a, dbo.t_CurrentConnect b, dbo.t_WorkingData c
where a.controlcabinetcode = b.controlcabinetcode and a.controlcabinetcode =c.controlcabinetcode
公式如下
节电率=[1-(输出电压/出入电压)平方]*100%
节电率:part
输入电压:inputvoltage
输出:outputvoltage
------解决方案--------------------convert(varchar,power((1-(inputvoltage/出入电压)),2)*100)+'%'