Page 1 of 1

Adding multiple records

Posted: Fri Jan 31, 2014 12:19 am
by DavJans
I was hoping someone could point me in the right direction.
What I have is a MySQL database that looks like this:
ID Employee Welds Fail Repair
1 10 5 0 0
2 53 10 0 0
3 10 0 3 0
4 22 0 0 3
5 53 3 0 0
6 244 0 0 8

my list at this point goes on and on, basically we check the welds that our employees do. How many, then they get inspected and we track how many failed and who repaired how many

what I need at this point is totals per employee and as a whole, I'm sure I can figure out how to add everything together to get total welds, fails and repairs, but what I'm unsure about is how to go about adding just the records where the employee is the same. Can I do this with one sql query that gives me all the data and add from there or should I do a query per employee? how would I do that when I don't want to script a query for every employee.

Thank you in advance

Re: Adding multiple records

Posted: Fri Jan 31, 2014 12:21 am
by DavJans
the forum omits multiple spaces in a row, I hope the table I tried to show is understandable.

Re: Adding multiple records

Posted: Fri Jan 31, 2014 12:53 am
by DavJans

Code: Select all

SELECT employee, SUM(weldqt) FROM cjp GROUP BY employee
I got this to work thank you :)

Re: Adding multiple records

Posted: Sat Feb 01, 2014 3:02 am
by Simon
Hi DavJans,
Really like this "Real World" application of liveCode :)

I don't think that an example of a liveCode product needs to be a killer app, would you consider writing a paragraph and posting a pic of it here:
http://livecode1001.blogspot.com/

Even if you are using drag n' drop controls and it doesn't look pretty it still is a meaningful application.

Simon