Home > Back-end >  Confusion about Mysql min function, solving the _ _ (: з) <)
Confusion about Mysql min function, solving the _ _ (: з) <)

Time:10-19

Just a query for a data and then the result is empty, when performing a=min how to keep his previous data? I made a mistake, or, less likely to cellar _ _ (: з)

CodePudding user response:

refer to the original poster trace e space-time response:
only a query for a data and then execute=min results is empty, how to keep his previous data? I made a mistake, or, less likely to cellar _ _ (: з)

SELECT a. ` account_id `, a. ` reg_time ` FROM users u
LEFT the JOIN
The accounts of a
ON
A. ` user_id `=u. ` user_id `
WHERE a. ` balance `=(SELECT MAX (accounts. ` balance `) FROM the accounts)
AND u. ` user_id `='123' GROUP BY (a. ` reg_time `) LIMIT 0, 1

By this way the others don't know much about the problem
  • Related