Can anyone explain to me how this mysql command will work?
SELECT @row := @row + 1 AS n_linha , m.* FROM
(SELECT b.user_id as prox_user_id, t.auctionID, t.productID, t.auc_due_price+t.auc_plus_price AS prox_valor, t.auc_due_time, b.id as id_lance, t.auc_plus_time, t.auc_plus_price
FROM bidbutler b
inner join c_cron_tempo t on b.auc_id = t.auctionID
where b.butler_status = 0 and (b.butler_bid-b.used_bids)>0
and t.auc_due_time < GREATEST(LEAST(TRUNCATE(15 * RAND(),0),15),3)
Order by b.auc_id, RAND()) m,(SELECT @row :=0) r;
Mostly the part of the RAND there, I could not understand.
I know that it runs on various RAND values, how could I also do it to run on a value set by me without RAND?