Generator without using tables for SQLite, postgresql:
WITH Recursive Q(Num,Prev) as( select 1,1 union all select Q.Num+Q.Prev,Q.Num from Q where Q.Num<10000 ) select Num from Q
If you need to select from them only those numbers that are in a certain table - then add the join to this final select with this table to check for the presence of a number in it.
For MS SQL and Oracle, remove the phrase Recursive from the query above. For Oracle, add an additional from DUAL after select 1,1 .
MySQL requires a reference table with the required number of records, the contents of these records do not matter:
select @tmp:=@Prev+@Num as Num, @Prev:=@Num, @Num:=@tmp from seqnum, (select @Prev:=1, @Num:=1) A order by Num
This is again a generator. To check the presence in a certain table, enclose it in a subquery and join.