Mysql分析

2018-01-07  本文已影响0人  蒋座
SELECT
    EVALUATION_STATUS,
    PROD_ID,
    a.ORDER_ID,
    a.PROD_SKU_ID
  FROM
      b2c_evaluation a,
      b2c_order o
  WHERE
      NOT EXISTS (
          SELECT
              1
          FROM
              b2c_evaluation
          WHERE
              ORDER_ID = a.ORDER_ID
          AND PROD_ID = a.PROD_ID
          AND PROD_SKU_ID = a.PROD_SKU_ID
          AND EVALUATION_STATUS != 4
          AND EVALUATION_STATUS > a.EVALUATION_STATUS
      )
  AND a.ORDER_ID = o.ORDER_ID
  AND o.ORDER_TYPE != '11'
  AND o.order_status = '04'
  AND a.EVALUATER_ID = #value:VARCHAR#
  ORDER BY
      EVALUATION_STATUS ASC,
      evaluation_time DESC

已评价列表 包括初评,追平(追平中要去除初次评价的信息),从两条相同信息的根据某个条件进行再次筛选

上一篇下一篇

猜你喜欢

热点阅读