Dibatalkan

Quite complicated mysql query comparing relation matches

I have a mySQL problem, where I need to calculate the SUM of rows after there is a mismatch in two relation tables. There are tests with numeric values and two part lists. Parts are usually included in both lists, and in this case all rows are summed up. Sometimes a part is only in the first list and not in the second, and in these cases all previous test values should be disregarded. In other words, rows should only be included in the sum if their test id is bigger than the last test id where this particular part was in list 1 but not in list 2.

There's a simplified mysql table listing at [url removed, login to view] where you can get an idea of the situation.

In this example, part 10 should sum all three test values, because the part is included in all lists, but part 20 should only return the value for test 3, as in test 2 it was not included in both in and out lists, and test 1 happened before test 2. So part 10 => 111 and part 20 => 100.

The job is to provide me with a MYSQL SELECT command, which returns the results specified above. Usage of complementary PHP and/or multiple queries is allowed, if the resulting code is faster.

I'll provide a more elaborate mysql dump to work with, so you can easily test your work.

Kemahiran: MySQL, PHP

Lihat lebih lanjut: matches list, list matches, job matches, quite complicated, relation, query table, mysql test, mysql query, php mysql query multiple, table queries, mysql tables rows, raw php code, mysql query php, select list php mysql, mysql query example, php mysql table, matches, mysql problem, calculate value, php mysql select table, pastebin, pastebin php, php pastebin, php mysql calculate, table dump php

Tentang Majikan:
( 44 ulasan ) Tirana, Finland

ID Projek: #1533869

13 pekerja bebas membida secara purata $72 untuk pekerjaan ini

astirbytes

Mysql expert. please check PM

$150 USD dalam sehari
(51 Ulasan)
5.6
garygoog

Hi,Please check PM

$80 USD dalam 4 hari
(54 Ulasan)
5.9
BitsLogic

We are a professionally managed IS0 9001:2008 certified web development company. Our team has extensive experience and we have provided services to reputed companies in US, UK, CANADA & Europe. Currently we have around Lagi

$100 USD dalam 2 hari
(5 Ulasan)
5.6
MHedayet

Hi, Please see my PM. I'm quite clear about the project but want to discuss more concerning expected runtime and other issues. Thanks!

$50 USD dalam sehari
(54 Ulasan)
5.2
alphawow

Hello, please provide clearer info about your query.

$30 USD dalam sehari
(18 Ulasan)
5.3
burtzerk

Hi Please see details of my bid in your PMB

$45 USD dalam 0 hari
(24 Ulasan)
5.3
piaoxin

Hi, johka0129. I can do it. Please check PM. Thanks and regards.

$80 USD dalam 0 hari
(23 Ulasan)
5.2
liuxinran

Hi, please read the PM.

$30 USD dalam sehari
(16 Ulasan)
4.1
bistanil98

Hi The price we have send you is for 5 days and 3 days is for testing so if you want exact price we can let you know after a detail discussion. I want to introduce our self, we are a group of freelancers have ex Lagi

$80 USD dalam 8 hari
(34 Ulasan)
6.8
navneet1986

please check pmb.

$90 USD dalam sehari
(0 Ulasan)
0.0
vikaspaliwal

Hi, I have gone through your requirement and understood the task we have READY to start right now. \

$30 USD dalam sehari
(0 Ulasan)
0.0
wethe5developer

We are happy to introduce us as a web-design & development company working in PHP, MySql, Symfony Framework, jQuery, Web-Design & AJAX since 2005. Our expert team always help client to meet any requirement and provide Lagi

$70 USD dalam 5 hari
(0 Ulasan)
0.0
tariqmth

Hi, Quite interesting job, I am expert in writing optimized SQL. I believe i can do this job easily Regards, Tariq

$99 USD dalam sehari
(0 Ulasan)
0.0