欧美1区2区3区激情无套,两个女人互添下身视频在线观看,久久av无码精品人妻系列,久久精品噜噜噜成人,末发育娇小性色xxxx

你想知道訂購 BR01 產(chǎn)品的日期,有表OrderItems代表訂單商品信息表,prod_id為產(chǎn)品id;Orders表代表訂單表有cust_id代表顧客id和訂單日期order_date;Customers表含有cust_email 顧客郵件和cust_id顧客id OrderItems表 Orders表 Customers表代表顧客信息,cust_id為顧客id,cust_email為顧客email 【問題】返回購買 prod_id 為BR01 的產(chǎn)品的所有顧客的電子郵件(Customers 表中的 cust_email),結(jié)果無需排序。 提示:這涉及 SELECT 語句,最內(nèi)層的從 OrderItems 表返回 order_num,中間的從 Customers 表返回 cust_id。 【示例結(jié)果】 返回顧客email cust_email 【示例解析】 產(chǎn)品id為BR01的訂單a0001和a002的下單顧客cust10和cust1的顧客email cust_email分別是:cust10@cust.com 、cust1@cust.com
示例1

輸入

DROP TABLE IF EXISTS `OrderItems`;
  CREATE TABLE IF NOT EXISTS `OrderItems`(
    prod_id VARCHAR(255) NOT NULL COMMENT '產(chǎn)品id',
    order_num VARCHAR(255) NOT NULL COMMENT '商品訂單號'
  );
  INSERT `OrderItems` VALUES ('BR01','a0001'),('BR01','a0002'),('BR02','a0003'),('BR02','a0013');

  DROP TABLE IF EXISTS `Orders`;
  CREATE TABLE IF NOT EXISTS `Orders`(
    order_num VARCHAR(255) NOT NULL COMMENT '商品訂單號',
    cust_id VARCHAR(255) NOT NULL COMMENT '顧客id',
    order_date TIMESTAMP NOT NULL COMMENT '下單時(shí)間'
  );
  INSERT `Orders` VALUES ('a0001','cust10','2022-01-01 00:00:00'),('a0002','cust1','2022-01-01 00:01:00'),('a0003','cust1','2022-01-02 00:00:00'),('a0013','cust2','2022-01-01 00:20:00');

DROP TABLE IF EXISTS `Customers`;
CREATE TABLE IF NOT EXISTS `Customers`(
    cust_id VARCHAR(255) NOT NULL COMMENT '顧客id',
    cust_email VARCHAR(255) NOT NULL COMMENT '顧客email'
  );
INSERT `Customers` VALUES ('cust10','cust10@cust.com'),('cust1','cust1@cust.com'),('cust2','cust2@cust.com');

輸出

cust_email
cust10@cust.com
cust1@cust.com
加載中...