select Pr ,Ph,(convert(int,Pr)/convert(int,Ph)) as 'Pr/Ph' from basic
你好对于你的要求 以上的语句就足以了 加减乘除,需要改动符号就行了 希望对你有所帮助
declare @tab table
(
Pr int,
Ph int,
[Pr/Ph] int
)
insert into @tab values(4,2,0)
select Pr,Ph,(Pr/Ph) as [Pr/Ph] from @tab
或者表@tab 不用[Pr/Ph]这个列 因为这列是通过计算得来的。
declare @tab table
(
Pr int,
Ph int
)
insert into @tab values(4,2)
select Pr,Ph,(Pr/Ph) as [Pr/Ph] from @tab
select 4 pr,2 ph,4/2 pr除ph from dual
select convert(int,pr)/convert(int,ph) from 表
select Pr,Ph ,Pr/Ph from 表 where Pr=2*Ph and ph<>0