高手幫幫忙求一SQL語句,高手 幫幫忙 求一SQL語句

2022-08-11 01:45:14 字數 897 閱讀 8357

1樓:匿名使用者

假設您的表名為test0817

語句如下

select a.mebid,sum(case a.ac when 0 then a.ab else a.ab*(-1) end) as 'zonghe'

from test0817 a

group by a.mebid

結果mebid zonghe

1 122

2 1110

2樓:

select

mebid,sum(case when ac=0 then ab when ac=1 then -ab end) as 總和

from 表

group by mebid

3樓:匿名使用者

select a.mebid,a.a-b.b from(select mebid,sum(ab) a from table where ac=0 group by mebid) a

left join

(select mebid,sum(ab) b from table where ac=1 group by mebid) b

on a.mebid= b.mebid

4樓:匿名使用者

select sum(ab) from tbl where ac = 0 group by mebid

這樣符合要求不?

5樓:西安_白小鵬

select mebid,sum(case when ac=0 then ab when ac=1 then ab*-1 end) as val

from t1

group by mebid

生物高手幫幫忙,生物高手幫幫忙

18.atp與rna的分子組成有什麼異同點?離體的色素能夠進行光合作用嗎?這些題根本不是高中要求的。高考絕對不會考!高考考的都是很基礎的,再簡單不過的 但是卻可以體現人綜合分析能力的題目。生物這門學科尤其如此。高中學的是方法,而不是知識。如果這是生物競賽題,我想說 扯淡!這對能力的培養絲毫沒有幫助!...

sql語句問題,請高手幫忙

select 學生.學號,姓名 from 學生,選課 選課1 where 學生.學號 選課1.學號 and not exists select from 選課 選課2 where 選課2.學號 s001 and not exists select from 選課 選課3 where 選課2.課程號 ...

彙編高手進來幫幫忙,彙編高手進來幫幫忙!!!!!!!

不是高手路過,練練手 data segment grade dw 87,89,52,63,47,95,100,52,96,88 rank dw 10 dup output db ranking 0dh,0ah,data ends code segment assume cs code,ds data...