You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Guys I'm having a hard time trying to figure out how to do the next subquery
declare @ventas as table(
semana int,
existencia int
);
declare @semanas as table(
semana int
);
insert into @ventas
values (1, 10),(3, 9),(5, 8);
insert into @semanas
values (1), (2), (3), (4), (5);
selects.semana,
isnull(v.existencia,
-- **** this part
(select top 1 existencia from @ventas where semana <s.semanaorder by semana desc) ) as existencia
from @semanas s
left outer join @ventas v onv.semana=s.semana
The text was updated successfully, but these errors were encountered:
Guys I'm having a hard time trying to figure out how to do the next subquery
The text was updated successfully, but these errors were encountered: