Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Possible Error in Data Retreival?
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: Possible Error in Data Retreival?
#31810
Possible Error in Data Retreival? 12 Years, 2 Months ago Karma: 2
Link: www.halscrib.com/index.php/web-club/results?Tournament=2012-09-11+19:00:00

SQL command:


Code:

SELECT
    IF(@LastScore9 <> Score, @CurrentRank9 := @CurrentRank9 + @NextRank9, @CurrentRank9) AS Rank, Player, Games, GamePoints, GamesWon, PointSpread, PlusPoints, Movie,
    IF(@LastScore9 = Score, @NextRank9 := @NextRank9 + 1, @NextRank9 := 1) as AddToGetNextRank9,
    @LastScore9 := Score AS Score
FROM Spreads
JOIN (SELECT @CurrentRank9 := 1, @LastScore9 := 0, @NextRank9 := 0) r
WHERE Tournament='2012-09-11 19:00:00' AND Games=9
ORDER BY Score DESC;



Look at the last line: ORDER BY Score DESC

But the data shows Score in ASC order!
The administrator has disabled public write access.
 
#31811
Re:Possible Error in Data Retreival? 12 Years, 2 Months ago Karma: 760
Hello,

Could you send SQL dump of "Spreads" table with sample data by email?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#31813
Re:Possible Error in Data Retreival? 12 Years, 2 Months ago Karma: 2
Done.
The administrator has disabled public write access.
 
#31815
Re:Possible Error in Data Retreival? 12 Years, 2 Months ago Karma: 760
Check your mail please.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#31840
Re:Possible Error in Data Retreival? 12 Years, 2 Months ago Karma: 2
I found the issue.

When my ranked-with-ties SQL query is executed by itself, the correct result is shown.

However, my query needs ranked-with-ties data from 3 subsets of the data.

I do this with the UNION statement: (query 1) UNION (query 2) UNION (query 3).

When I introduce the union statement, the ranked-with-ties system breaks down and no longer works.
Last Edit: 2012/09/12 12:34 By JugglingReferee.
The administrator has disabled public write access.
 
#31932
Re:Possible Error in Data Retreival? 12 Years, 2 Months ago Karma: 2
I've decided to abandon the use of the UNION keyword. It's unreliable.

Instead, I've going to modify my exist single SELECT statement to handle different Games values.
The administrator has disabled public write access.
 
Go to topPage: 12