SQL筛选两个字段同时满足条件的结果
现在有一张student表,包含三个字段:s_id,c_id,s_score。
目的1:只保留得到s_id为01,s_score为80的结果

输入语句:

select * from score where case when s_id =01 and s_score =80 then 0 else 1 end=
0;

结果:
SQL筛选两个字段同时满足条件的结果

目的2:筛选除同时满足s_id为01,s_score为80以外的所有数据
输入语句:

select * from score where case when s_id =01 and s_score =80 then 0 else 1 end=
1;

输出结果:
SQL筛选两个字段同时满足条件的结果

相关文章:

  • 2021-11-24
  • 2022-12-23
  • 2021-04-20
  • 2022-01-28
  • 2022-12-23
  • 2021-11-27
  • 2021-11-19
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2022-01-09
相关资源
相似解决方案