SQL仓库

1. 查表中数据个数

select count(*) from table_name where condition 

2. 删除表中数据

delete from table_name where condition

3.筛选符合条件数据并且将结果根据条件公式求和

SELECT
   sum(case 
   	   when transaction_state ='B' then transaction_amount
   	   when transaction_state ='s' then -transaction_amount 
   end
   )as result
FROM 
    stocktransactiondetail_april 
WHERE 
    stock_symbol ='sz300347' AND (transaction_date ='2024-04-19' or transaction_date ='2024-04-22' or transaction_date ='2024-04-23') AND transaction_amount >1000000;

相关推荐

  1. SQL仓库

    2024-04-24 18:08:03       30 阅读
  2. SQL】力扣1571. 仓库经理

    2024-04-24 18:08:03       57 阅读
  3. Git 克隆 GitHub 仓库时遇到了 SSL 证书问题

    2024-04-24 18:08:03       30 阅读
  4. <span style='color:red;'>SQL</span>

    SQL

    2024-04-24 18:08:03      19 阅读
  5. YUM<span style='color:red;'>仓库</span>

    YUM仓库

    2024-04-24 18:08:03      53 阅读
  6. Git仓库

    2024-04-24 18:08:03       47 阅读
  7. Docker:登录私有仓库\退出私有仓库

    2024-04-24 18:08:03       54 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-24 18:08:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-24 18:08:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-24 18:08:03       82 阅读
  4. Python语言-面向对象

    2024-04-24 18:08:03       91 阅读

热门阅读

  1. 嵌入式Linux—Framebuffer应用编程

    2024-04-24 18:08:03       38 阅读
  2. 研发管理规范

    2024-04-24 18:08:03       28 阅读
  3. 红帽系统Redhat忘记密码,重置root密码

    2024-04-24 18:08:03       31 阅读
  4. 神经网络与深度学习(四)

    2024-04-24 18:08:03       25 阅读
  5. ORA-25153:临时表空间为空

    2024-04-24 18:08:03       30 阅读
  6. 程序员的压力缓解之道:寻找工作与生活的平衡

    2024-04-24 18:08:03       32 阅读
  7. 孩子如何才能学好Scratch

    2024-04-24 18:08:03       26 阅读
  8. OpenResty实现限流的几种方式

    2024-04-24 18:08:03       28 阅读
  9. c++11引入的constexpr关键字

    2024-04-24 18:08:03       34 阅读