Get missing record from column using while loop in SQL Server

Last Reply one year ago By dharmendr

Posted one year ago

Hi! I have table with data in sql. But I want find missing number from table.

Id

NamePeople

Address

RecieptNumber

1

Pulodov Rustam

city Dushanbe

1778

2

Soliev Firuz

city Hisor

1779

3

Sharipov Sadriddin

city Dushanbe

1981

4

Asrori Yatim

city Kulob

1982

5

Mallaev Nurullo

city Dushanbe

1984

Here missing recieptnumber 1980 and 1983. Every day I insert data into table. I want query get missing recieptnumber.

Output result:

1980

1983

Because hasn't it in order.