select u.username, sum(abs(h.actual_amount) * (h.type = 'deposit')) as deposit, sum(abs(h.actual_amount) * (h.type = 'sell')) as sell, sum(abs(h.actual_amount) * (h.type = 'withdrawal')) as withdrawal from sh_users as u left outer join sh_history as h on u.id = h.user_id where h.type in ('deposit', 'sell', 'withdrawal') and user_id != 1 group by u.username having sum(abs(h.actual_amount) * (h.type = 'deposit')) > 0 or sum(abs(h.actual_amount) * (h.type = 'sell')) > 0 or sum(abs(h.actual_amount) * (h.type = 'withdrawal')) > 0 order by u.username limit -20, 20 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 20 stock.softhyip.net
Home  |  Sign Up  |  Login FAQ  |  Rules  |  Support
stock.softhyip.net
  
 
:: Stats

:: Info


Members Stats

Username Deposited Sell Withdrawn
No transactions found
All Rights Reserved. stock.softhyip.net