i use a query but i repeat the subquery 2 times.
is there a way that i can save in variable or optimize it so i dont call 2 times the subquery below:
SELECT phone FROM sku WHERE id=10
i tried this @phone:= (SELECT phone FROM sku WHERE id=10); but cant make it work
SELECT kred -
( SELECT SUM((UNIX_TIMESTAMP()-timeStampSecondsColumn)* 0.1666666666666667) as total
FROM sku
WHERE phone=(SELECT phone FROM sku WHERE id=10) as Kred2
from users
WHERE phone=(SELECT phone FROM sku WHERE id=10)