چرک نویس شخصی علی صفرنواده

در اینجا نکات جالب در زمینه های مختلف، برنامه ریزی روزانه، هفتگی و ...، هدف گذاری و همچنین ثبت خاطرات مختصر را انجام می دهم.

چرک نویس شخصی علی صفرنواده

در اینجا نکات جالب در زمینه های مختلف، برنامه ریزی روزانه، هفتگی و ...، هدف گذاری و همچنین ثبت خاطرات مختصر را انجام می دهم.

این بلاگ در واقع بولت ژورنال منه. بولت ژورنال یه روش انعطاف پذیر برنامه ریزی است. خیلی بهتره دفتر کاغذی برای بولت ژورنال استفاده شه و همراه آدم باشه. راستش چند بار سعی کردم، ولی دفتر رو گم می کنم، جا میذارم و یادم میره با خودم ببرم. در واقع اینجا برام نقش بولت ژورنال رو داره.
برای اطلاعات بیشتر درباره بولت ژورنال این وبینار رو ملاحظه بفرمایید:
https://www.aparat.com/v/91GuD
برای اطلاعات بیشتر درباره مدیریت زمان این صفحه رو ملاحظه بفرمایید:
https://planacademy.ir

  • ۰
  • ۰

Here’s a quick summary of OVER and PARTITION BY (new in SQL 2005), for the uninitiated or forgetful…

OVER

OVER allows you to get aggregate information without using a GROUP BY. In other words, you can retrieve detail rows, and get aggregate data alongside it. For example, this query:

SELECT SUM(Cost) OVER () AS Cost
, OrderNum
FROM Orders

Will return something like this:

Cost  OrderNum
10.00 345
10.00 346
10.00 347
10.00 348

Quick translation:

  • SUM(cost) – get me the sum of the COST column
  • OVER – for the set of rows….
  • () – …that encompasses the entire result set.

OVER(PARTITION BY)

OVER, as used in our previous example, exposes the entire resultset to the aggregation…”Cost” was the sum of all [Cost]  in the resultset.  We can break up that resultset into partitions with the use of PARTITION BY:

SELECT SUM(Cost) OVER (PARTITION BY CustomerNo) AS Cost
, OrderNum
, CustomerNo

FROM Orders

My partition is by CustomerNo – each “window” of a single customer’s orders will be treated separately from each other “window”….I’ll get the sum of cost for Customer 1, and then the sum for Customer 2:

Cost  OrderNum   CustomerNo
8.00 345        1
8.00 346        1
8.00 347        1
2.00 348        2

The translation here is:

  • SUM(cost) – get me the sum of the COST column
  • OVER – for the set of rows….
  • (PARTITION BY CustomerNo) – …that have the same CustomerNo.
  • ۹۵/۱۲/۰۸
  • علی صفرنواده

نظرات (۰)

هیچ نظری هنوز ثبت نشده است

ارسال نظر

ارسال نظر آزاد است، اما اگر قبلا در بیان ثبت نام کرده اید می توانید ابتدا وارد شوید.
شما میتوانید از این تگهای html استفاده کنید:
<b> یا <strong>، <em> یا <i>، <u>، <strike> یا <s>، <sup>، <sub>، <blockquote>، <code>، <pre>، <hr>، <br>، <p>، <a href="" title="">، <span style="">، <div align="">
تجدید کد امنیتی