当前位置: 代码迷 >> SQL >> 经典SQL_一
  详细解决方案

经典SQL_一

热度:33   发布时间:2016-05-05 11:54:03.0
经典SQL_1

此SQL 用到了mysql的时间戳,子查询,mysql运算

--------------------

SELECT
de_id,FROM_UNIXTIME(de_due_date)
FROM
`p2p_repayments_details`
WHERE de_due_date<(UNIX_TIMESTAMP()-
?? (SELECT (86400*
??? (SELECT cfd.cd_overdue_avi_day FROM p2p_customer_formula_set AS cfs
??? LEFT JOIN p2p_customer_formula_detail AS cfd ON cfs.m_sour_grade_id = cfd.cd_id
??? LEFT JOIN p2p_bidding AS b ON cfs.c_id=b.b_customer
??? WHERE b.b_customer=218 LIMIT 1)))
) AND de_status IN (1,2)

  相关解决方案