mysql多表左链接查询

2023-11-13 20:16:39 浏览数 (1)

事例:

代码语言:javascript复制
SELECT
	a.gifts_num,
	a.current_num,
	a.nick_name,
	a.sku_id,
	a.sku_name,
	a.sku_price,
	a.create_time,
	b.plat_order_id,
	b.nick_name,
	c.sendee_address_info,
	b.thanks_content 
FROM
	share_gifts_info AS a
	LEFT JOIN (
		get_gifts_info AS b
		LEFT JOIN (
			order AS c
			LEFT JOIN ( 
				store_deliver_goods AS d  LEFT JOIN store_waybill AS e 
					ON d.waybill_id = e.id 
				) ON c.plat_order_id = d.plat_order_id 
		) ON b.plat_order_id = c.plat_order_id 
	) ON a.share_gifts_info_id = b.share_gifts_info_id
  • UNIX_TIMESTAMP(datetime)
  • FROM_UNIXTIME(unixtime)

0 人点赞