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
select count(*) as [Count], Avg(Amount) as [Average], Sum(Amount)/2 as [Sum divided by 2] from dbo_OrderLineItems where OrderId in
(
select Id from dbo_Orders where CustomerId in
(
'GUIDGUID-GUID-GUID-GUID-GUIDGUID',
'GUIDGUID-GUID-GUID-GUID-GUIDGUID',
'GUIDGUID-GUID-GUID-GUID-GUIDGUID'
) and (Cast(CreatedDate as date) between '01 June 2022' and '31 July 2022')
)
How do I select last 5 rows in a table without sorting?
select Name
from (
select top 5 Name
from MyTable
order by Name desc
) a
order by Name asc