declare
@ids
int
=1
declare
@
count
int
while @ids<471
begin
select
@
count
=
COUNT
(*)
From
LotNO
where
cLotNO=(
select
cLotNO
From
LotNO
where
Auto_ID=@ids)
if @
count
>1
begin
delete
from
LotNO
where
Auto_ID=@ids
end
select
@ids+=1
end