mysql 查询

 

SELECT 
t1.record_player_id, ifnull(t2.sum_recrod,0) as 'sum_recrod'
FROM ceshi1 as t1
LEFT JOIN (
SELECT 
s1.record_player_id,
sum(s1.record_user_soure) as 'sum_recrod'
FROM ceshi1 as s1
WHERE s1.record_create_time >= '2018-09-23'
GROUP BY s1.record_player_id
ORDER BY s1.record_user_soure DESC
LIMIT 3
) as t2
ON t2.record_player_id = t1.record_player_id
WHERE t1.record_create_time >= '2018-09-23'
GROUP BY t1.record_player_id

解决MySQL 导入的时间问题

set session sql_mode='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';

连表查询

SELECT * FROM tiger_sign_apply as a
LEFT JOIN tiger_loan_apply as app ON app.id = a.loan_apply_id
LEFT JOIN tiger_borrower as u ON u.id = app.user_id
LEFT JOIN 
 (select * from (select * from `tiger_loan_repay_plan` order by `periods_order` desc) `temp`  group by loan_sign_id) as t on t.loan_sign_id = a.id

 

<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/2 0002
 * Time: 20:54
 */
$num = mt_rand(0,6);
$array_word=[
    [],
    ['恭','恭','恭'],
    ['喜','喜','喜','喜'],
    ['发','发','发','发'],
    ['财','财','财','财','财'],
    ['福','福','福','福','福'],
    ['新','年','快','乐']
];
echo $num;
$word =[];
foreach($array_word as $k=>$v){
    $count = mt_rand(1,2);
    if($num == $k){
        $count =0;
    }
    for($i=$count;$i<=count($v);$i++ ){
        if(!empty($v[$i])){
            array_push($word,$v[$i]);
        }
    }
}

$word_count = count($word);

for($j=$word_count;$j<20;$j++){
    array_push($word,$array_word[6][mt_rand(1,3)]);
}
shuffle($word);
print_r( $word);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值