SELECT pr.PRODUCT_ID, pr.PRODUCT_NAME, pr.ORIGINAL_PRICE, pr.ONLINE_PRICE, pr.COMMISSION_PERCENT, pr.TOTAL_SALES, pr.SHOP, dict.label AS COMMERCE_TYPE_LABEL, pr.SERVICE_RATE, ord.ORDER_ID, date.label AS SEND_FLG_LABEL, pro.CONNECT_BUSINESS_FLG, address.APPLY_REMARK, address.CREATE_TIME, users.nicknameFROM t_product AS prLEFT JOIN t_order AS ord ON ord.PRODUCT_ID = pr.IDLEFT JOIN ( SELECT label, `value` FROM system_dict_data WHERE dict_type = 'COMMERCE_TYPE' ) AS dict ON dict.`value` = pr.COMMERCE_TYPE LEFT JOIN ( SELECT label, `value` FROM system_dict_data WHERE dict_type = 'trade_after_sample_type' ) AS date ON date.`value` = ord.SEND_FLGLEFT JOIN t_apply_pro AS pro ON pro.PRODUCT_ID = pr.IDLEFT JOIN t_apply_pro_user_address AS address ON address.t_apply_pro_id = pro.IDLEFT JOIN system_users AS users ON users.id = pro.OPERATE_USER_ID WHERE users.id = '1'
时间: 2024-02-29 18:55:36 浏览: 87
prot_IEC104.zip_IEC104.c_iec104
这是一个SQL语句,查询了多张表的数据并进行了联合查询,最终筛选出符合条件的数据。具体查询条件为:查询商品表t_product中的PRODUCT_ID、PRODUCT_NAME、ORIGINAL_PRICE、ONLINE_PRICE、COMMISSION_PERCENT、TOTAL_SALES、SHOP、COMMERCE_TYPE_LABEL、SERVICE_RATE字段,同时关联订单表t_order,查询ORDER_ID、SEND_FLG_LABEL字段,关联申请表t_apply_pro,查询CONNECT_BUSINESS_FLG字段,关联申请地址表t_apply_pro_user_address,查询APPLY_REMARK、CREATE_TIME字段,同时关联用户表system_users,查询nickname字段。其中,使用LEFT JOIN进行表的关联,使用WHERE进行条件筛选,筛选条件为users.id = '1'。
阅读全文