mysql - select sum(amount) as total with condition on total -


I want to receive users with total transactions greater than 50000

  SELECT sum ( Traction zodiac) as a total, user_id from `transaction` where` total` & gt; 50000 by group user_id  

I get this error

  # 1054 - Unknown column 'total' in 'where volume'  

There is no total column in the curse table, but how should I write the status?

You need the ones section with a Code Yoga:

  select as the total amount (tracks.mount), user_id from user_id, total number of `tractions` from group & gt; 50000; Edit:  

If I am writing this query, then it will look like:

  select t.user_id, sum ( T.Mount) as the total amount T group by T. (t.amount) & gt; 50000;  

I'm getting scrambled with encrypted keywords. I (almost) are always collecting the fields at the beginning of a line. I am expanding table aliens and have short form for table I ignore identifiers because I never use extraordinary characters in reserved word or identifier. I have put an expression in the ones section because. . . Okay, I think at one time at a time, all the databases are not supported using the column aliases in the ones sections.


Comments