UncleRonin
Well-known member
Okay, i find this to be particularly weird. I've seen this with MySQL but haven't tested it with any other DB servers.
If I execute this query I get a result of x for AH.
If I execute this query I get a result of y for AH.
If I execute this query I get a result of z for AH.
If I execute this query I get a result of v for AH.
What the hell! The last two queries SHOULD return the same result but they differ considerably. I mean, there is no actual difference in the queries. Even if I refer to the fields specifically with A.A_Hours, etc. there is no change in the differing results.
Can somebody explain to me what the problem is exactly? I've never encountered this sort of problem before and never would've if I hadn't checked the results against each other. Is this a problem with MySQL (4.*) or is it a problem with the actual queries themselves? This is really bizarre and because of it I'm gonna have to go and check every other query I've used - which is over 500!
If I execute this query I get a result of x for AH.
VB.NET:
SELECT SUM(A_Hours) AS AH, SUM(B_Total) AS BT FROM A, B, C WHERE A_C = C_Code AND B_C = C_Code AND C_Code = "Code"
VB.NET:
SELECT SUM(A_Hours) AS AH FROM A, C WHERE A_C = C_Code AND C_Code = "Code"
VB.NET:
SELECT SUM(A_Hours) AS AH FROM A, C WHERE A_C = "Code"
VB.NET:
SELECT SUM(A_Hours) AS AH FROM A WHERE A_C = "Code"
Can somebody explain to me what the problem is exactly? I've never encountered this sort of problem before and never would've if I hadn't checked the results against each other. Is this a problem with MySQL (4.*) or is it a problem with the actual queries themselves? This is really bizarre and because of it I'm gonna have to go and check every other query I've used - which is over 500!