select sum(a1.`num`)   from `order_orderlistrow` as a1 INNER JOIN `order_orderlist` as a2 on a1.`order_orderlist_id`  = a2.`id`  where a1.`goods_good_id` ='54' and a2.`state` <> '0'

sql语句 两表关联查询计算数量的更多相关文章

  1. MyBatis 中两表关联查询MYSQL (14)

    MyBatis 中两表关联查询MYSQL 1.创建数据库表语句 2.插入测试数据 3.pom文件内容 <?xml version="1.0" encoding="U ...

  2. oracle 两表关联查询

      oracle 两表关联查询 CreationTime--2018年7月4日17点27分 Author:Marydon 情景描述 查询学生表student,sname,sex,age信息及所在班级c ...

  3. Hibernate criteria 混合sql语句多表关联时查询注意事项

    直接进入正题 假设有一个实体类 /** * 产品分类 */ public class ProductType{ @Id private String no;//编号 private String na ...

  4. Oracle - 查询语句 - 多表关联查询

    /* SQL语句的历史版本 SQL89 比较多 SQL92 SQL99 多表关联查询 笛卡尔积 等值关联查询 非等值关联查询 左外连接 右外连接 全外连接 自连接 */ --------------- ...

  5. SQL 两表关联查询 where 条件中等号两端字段顺序对效率的影响

    现有两表A(大).B(小)作关联查询,SQL语句如下: SQL1:select * from A,B where A.id = B.id SQL2:select * from A,B where B. ...

  6. SQL语句多表连接查询语法

    一.外连接 1.左连接  left join 或 left outer join SQL语句:select * from student left join score on student.Num= ...

  7. MySQL常用sql语句-----数据表的查询操作

    常用的sql语句如下,应对工作足以 1.查询指定字段 select c_id,c_age,c_name from t_student; select c_id as 编号,c_name as 姓名,c ...

  8. mysql update语句添加表关联查询

    UPDATE tab_game_version  as a INNER JOIN tab_game_version as b ON a.id=b.idSET a.advert_data=0 where ...

  9. 详解MongoDB中的多表关联查询($lookup)

    一.  聚合框架 聚合框架是MongoDB的高级查询语言,它允许我们通过转换和合并多个文档中的数据来生成新的单个文档中不存在的信息. 聚合管道操作主要包含下面几个部分: 命令 功能描述 $projec ...

随机推荐

  1. javaMail 详解

    原文:http://www.matrix.org.cn/resource/article/44/44101_JavaMail.html 一.JavaMail API简介JavaMail API是读取. ...

  2. MySQL 一次非常有意思的SQL优化经历:从30248.271s到0.001s

    转载自:https://www.toutiao.com/i6668275333034148356 一.背景介绍 用的数据库是mysql5.6,下面简单的介绍下场景 课程表: 数据100条 学生表: 数 ...

  3. [Luogu] 染色

    https://www.luogu.org/problemnew/show/P2486 qizha 为什么会wa #include <cstdio> #include <cmath& ...

  4. GAN生成式对抗网络(三)——mnist数据生成

    通过GAN生成式对抗网络,产生mnist数据 引入包,数据约定等 import numpy as np import matplotlib.pyplot as plt import input_dat ...

  5. Ubuntu 16.04 下Redis Cluster集群搭建

    实际操作如下: 准备工作 版本:4.0.2 下载地址:https://redis.io/download 离线版本:(链接: https://pan.baidu.com/s/1bpwDtOr 密码: ...

  6. C++ 2048游戏

    2048游戏实现起来还是比较简单的,注意几个细节,调几个bug就好了. 直接上源码,需要的可以拿走(手动滑稽 /*dos windows 25*80*/#include <algorithm&g ...

  7. Mac下Maven的删除和安装

    一 删除maven 找到当前的maven路劲:使用mvn -v查看当前maven的安装目录在哪 删掉sudo rm -rf [maven的路径] 二 安装maven 1.下载maven压缩包 mac下 ...

  8. c#简单的SQLHelp

    public abstract class SQLHelper { //只读的静态数据库连接字符串 //需添加引用System.Configuration; public static readonl ...

  9. nginx使用certbot配置https

    一般现在的网站都要支持https,即安全的http. 机器:阿里云Ubuntu 16.04.3 LTS 方案一:自己申请证书 配置时需要确保有ssl模块, 之后域名解析下, 之后时申请证书,可以去阿里 ...

  10. PyTricks-使用namedtuple以及dataclass的方式定义类

    from collections import namedtuple from dataclasses import dataclass # 以前简单的类可以使用namedtuple实现. Car = ...