MySQL

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDatabasesMySQL

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old April 11th, 2016, 01:53 PM
elrobbo6 elrobbo6 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Apr 2016
Posts: 1 elrobbo6 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 25 sec
Reputation Power: 0
Need help with this query please!!

SELECT value AS $point_fld,
COUNT(value) as cnt
FROM ?_data d
LEFT JOIN ?_user u
ON d.`table` = 'user' AND d.`id` = u.user_id
WHERE `key` = ? AND `value`<>'' AND `value`<>'Blank' AND u.added BETWEEN ? AND ?
LEFT JOIN ?_invoice_payment p
ON d.'id' = p.user_id
SUM(p.amount) as moneysum

GROUP BY $point_fld"

So I am trying to edit this query to add in a sum value for payments based on which users are returned in the first part. The red text is what I added. It is working just as intended but when i add in my part to get the values it breaks it. Any suggestions would be amazing thanks. Im pretty new to joins and stuff in sql so be nice

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesMySQL > Need help with this query please!!


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap