# SQL Antipatterns, Volume 1: Bad column in partition by example (page 107)

**URL:** <https://forum.devtalk.com/t/sql-antipatterns-volume-1-bad-column-in-partition-by-example-page-107/81455>\
**Category:** PragProg Customers\
**Tags:** book-sql-antipatterns-volume-1, errata\
**Created:** [5 November 2022 08:56 UTC](https://forum.devtalk.com/t/sql-antipatterns-volume-1-bad-column-in-partition-by-example-page-107/81455 "2022-11-05T08:56:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![crash](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/c/c0e974/32.png) [@crash](https://forum.devtalk.com/u/crash)\
**Post date:** [5 November 2022 08:56 UTC](https://forum.devtalk.com/t/sql-antipatterns-volume-1-bad-column-in-partition-by-example-page-107/81455/1 "2022-11-05T08:56:18Z")

</div>

@billkarwin

You say partitioning by date\_reported but in the example there is a partition by hash ( bug\_id ).

---

<div class="post-metadata">

**Author:** ![billkarwin](https://forum.devtalk.com/user_avatar/forum.devtalk.com/billkarwin/32/3276_2.png) [@billkarwin](https://forum.devtalk.com/u/billkarwin)\
**Post date:** [7 November 2022 21:11 UTC](https://forum.devtalk.com/t/sql-antipatterns-volume-1-bad-column-in-partition-by-example-page-107/81455/2 "2022-11-07T21:11:45Z")

</div>

Thank you for identifying this mistake. A more clear example should be “PARTITION BY HASH( TO\_DAYS(date\_reported) )”.
