Collecting Wisdom

Collecting Wisdom

Skip to content
Menu

Category: Uncategorized

Uncategorized

PostgreSQL: How to Get the Last Day of the Week

Posted on October 22, 2024 by Zach

Often in PostgreSQL you may want to get the last day of the week. You can use the following basic syntax to do so: SELECT…

Uncategorized

PostgreSQL: How to Get the End of a Day

Posted on October 22, 2024 by Zach

Often in PostgreSQL you may want to create a timestamp that represents the end of the day for a particular date. You can use the…

Uncategorized

PostgreSQL: Create New Column Based on Another Column

Posted on October 22, 2024 by Zach

Often in PostgreSQL you may want to create a new column in a table whose values are based on the values from another column. You…

Uncategorized

PostgreSQL: How to Cast JSONB to Integer

Posted on October 22, 2024 by Zach

Often in PostgreSQL you may want to cast a key in a JSONB column to an integer. You can use the following syntax to do…

Uncategorized

PostgreSQL: How to Use Concat in a WHERE Clause

Posted on October 22, 2024 by Zach

Often in PostgreSQL you may want to concatenate strings inside of a WHERE clause. You can use the following syntax to do so: SELECT *…

Uncategorized

How to Calculate a Weighted Average in PostgreSQL

Posted on October 21, 2024 by Zach

Often in PostgreSQL you may want to calculate a weighted average using two columns in a table. You can use the following basic syntax to…

Uncategorized

PostgreSQL: How to Order by Month Name

Posted on October 21, 2024 by Zach

Often in PostgreSQL you may want to order the rows of a table based on a column that contains month names. You can use the…

Uncategorized

PostgreSQL: How to Get Week Number from Date

Posted on October 21, 2024 by Zach

Often in PostgreSQL you may want to get the week number from a date. You can use the following syntax to do so: SELECT *,…

Uncategorized

PostgreSQL: How to Use Custom Order for UNION Results

Posted on October 21, 2024 by Zach

Often in PostgreSQL you may want to specify a custom order for the resulting rows of a UNION between two tables. You can use the…

Uncategorized

PostgreSQL: Remove Duplicate Rows Based on Two Columns

Posted on October 21, 2024 by Zach

Often in PostgreSQL you may want to remove duplicate rows from a table based on duplicate values in two columns. You can use the following…

Uncategorized

PostgreSQL: Count Business Days Between Two Dates

Posted on October 21, 2024 by Zach

Often in PostgreSQL you may want to count the number of business days between two dates. You can create the following function named business_days() to…

Posts pagination

Previous Page Page 1 Page 2 Page 3 … Page 88 Next Page

Search

© 2024 Collecting Wisdom | Privacy Policy
Wisteria Theme by WPFriendship ⋅ Powered by WordPress