备份

SELECT
		move_user.name,
		move_user.mobile,
		FROM_UNIXTIME( move_user.create_time ),
		move_user_channel.openid,
		move_user_channel.app,
		move_user_channel.session_key,
		move_user_channel.gid,
		move_user_channel.extappid,
		move_user_channel.dist,
		move_user_channel.point,
		move_user_channel.total_point,
		move_user_info.uid,
		move_user_info.role,
		move_user_info.status,
		move_user_info.nickname,
		move_user_info.avatarurl,
		move_user_info.gender,
		move_user_info.country,
		move_user_info.province,
		move_user_info.city,
		move_user_info.id_type,
		move_user_info.id_number,
		move_user_info.address,
		move_user_info.reg_user_id,
		move_user_info.jdid,
		move_user_info.verifytime,
		move_user_info.phone_token,
		move_user_info.token_time,
		move_user_info.validity,
		move_user_info.logindays,
		move_user_info.email,
		move_user_info.birth,
		move_user_info.appid,
		move_user_info.login_type,
		move_user_info.login_id,
		move_user_info.district,
		move_user_info.street
FROM
		move_user
		JOIN move_user_channel ON move_user.unionid = move_user_channel.unionid
		JOIN move_user_info ON move_user.id = move_user_info.uid 
LIMIT 0,10
select a.dd-c.ff+b.ee from 
(select count(unionid) dd from move_user ) a,
(select count(unionid) ee from move_user_channel) b,
(select count(distinct unionid) ff from move_user_channel) c
SELECT
	a.unionid,
	a.NAME,
	a.mobile,
	FROM_UNIXTIME( a.create_time ),
	b.openid,
	b.app,
	b.session_key,
	b.gid,
	b.extappid,
	b.dist,
	b.point,
	b.total_point,
	move_user_info.uid,
	move_user_info.role,
	move_user_info.STATUS,
	move_user_info.nickname,
	move_user_info.avatarurl,
	move_user_info.gender,
	move_user_info.country,
	move_user_info.province,
	move_user_info.city,
	move_user_info.id_type,
	move_user_info.id_number,
	move_user_info.address,
	move_user_info.reg_user_id,
	move_user_info.jdid,
	move_user_info.verifytime,
	move_user_info.phone_token,
	move_user_info.token_time,
	move_user_info.validity,
	move_user_info.logindays,
	move_user_info.email,
	move_user_info.birth,
	move_user_info.appid,
	move_user_info.login_type,
	move_user_info.login_id,
	move_user_info.district,
	move_user_info.street 
FROM
	(
	SELECT
		* 
	FROM
		move_user 
	WHERE
		unionid IS NOT NULL 
		LIMIT 0,
		10 
	) a
	LEFT JOIN (
	SELECT
		a.* 
	FROM
		(
		SELECT
			unionid,
			openid,
			app,
			session_key,
			gid,
			extappid,
			dist,
			point,
			total_point,
			create_time 
		FROM
			move_user_channel 
		) a,
		(
		SELECT
			unionid,
			max( create_time ) create_time 
		FROM
			move_user_channel 
		WHERE
			TRIM( unionid ) IN (
			SELECT
				unionid 
			FROM
				( SELECT unionid FROM move_user LIMIT 0, 10 ) AS t 
			) 
		GROUP BY
			unionid 
		) b 
	WHERE
		a.unionid = b.unionid 
		AND a.create_time = b.create_time 
	) b ON a.unionid = b.unionid
	LEFT JOIN move_user_info ON a.id = move_user_info.uid 
	LIMIT 0,
	10
SELECT count(*) FROM move_user
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值