MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 20th, 2007, 07:09 AM
icuras icuras is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2007
Posts: 3 icuras User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 31 sec
Reputation Power: 0
Angry Mysql join

I have the query like this.

select a.employee as vvEmpNo, sum(Empvalue) as vvEmpvalue, count(Employee) as vvCount
from Employeetable a left join worktable b
on a.employee = b.empno
group by a.employee
order by a.employee

Wel i have 200 employees in the EMPLOYEETABLE and 70000 records en the Worktable..

This query hangs on me....i dont know why..

the Worktable looks like this.

empno, value, balls, date

Emp1, 200, 6, 23/07/2007
EMP1, 4, 1, 17/07/2007
EMP2, 500, 700, 27/07/2007
EMP2, 0, 0, 20/07/2007
EMP2, 234, 212, 22/07/2007

What i want is this

There will be 63 fields.1st field the employeeno then the rest the days of the month

EMP1, DAY1 TOTVALUE, DAY1 TOTBALLS, DAY2 TOTVALE, DAY@ TOTBALLS [ETC until 31 days]

EMP2, DAY1 TOTVALUE, DAY1 TOTBALLS, DAY2 TOTVALE, DAY@ TOTBALLS [ETC until 31 days]

Can someone help me please. I have written a procedure to put everything in a 3rd table as well but that takes up to 45 minutes to do.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Mysql join


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT