SQL求小于1000的所有水仙花数

DECLARE i INT
SET i=10
WHILE i<1000
BEGIN
IF POWER(floor(i/100),3)+POWER(floor(i/10)%10,3)+POWER(i%10,3)=i
PRINT i
END

编程技巧