order by in sql
ORDER BY: is for sorting result
either in descending or ascending order.
order by in sql
ORDER BY: is for sorting result
either in descending or ascending order.
partition by sql server
-- When using an aggregation function (SUM, COUNT, RANK, etc...)
-- Creates a specification on which you need to perform that agreggation
-- Example:
SELECT Customercity,
SUM(Orderamount) OVER(PARTITION BY Customercity) AS SumOrderAmount
-- performs avg amount when and only when you see a customer city
-- Orderamount | Customercity --(Comment added)-- | SumOrderAmount
-- 100 | Chicago "partition1" | 250
-- 150 | Chigago "partition1" | 250
-- 50 | Houston "partition2" | 75
-- 25 | Houston "partition2" | 75
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us