MySQL, IF statement, variables, and NULL
INSERT INTO test (number)
SELECT COALESCE(MAX(number), 1)
FROM test;


UPDATE

If record(s) exists we need in the next value. So:

INSERT INTO test (number)
SELECT 1 + COALESCE(MAX(number), 0)
FROM test;