Collecting Wisdom

Collecting Wisdom

Skip to content
Menu

Author: Zach

Uncategorized

PostgreSQL: How to Extract Value from XML Tag

Posted on October 23, 2024October 23, 2024 by Zach

Often in PostgreSQL you may want to extract a specific value from an XML tag. You can use the xpath() function with the following syntax…

Uncategorized

PostgreSQL: How to Get the Start of a Day

Posted on October 23, 2024 by Zach

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

Uncategorized

PostgreSQL: How to Get File Extension from Filename

Posted on October 23, 2024 by Zach

Often in PostgreSQL you may want to get the file extension from a string column that contains a filename. You can use the following syntax…

Uncategorized

PostgreSQL: How to Update Single Property Value in JSONB

Posted on October 23, 2024 by Zach

Often in PostgreSQL you may want to update a single property value in a JSONB column. You can use the following basic syntax to do…

Uncategorized

PostgreSQL: How to Calculate Average Timestamp

Posted on October 23, 2024 by Zach

Often in PostgreSQL you may want to calculate the average of values in a timestamp column. You can use the following syntax to do so:…

Uncategorized

PostgreSQL: How to Select Timestamp without Seconds

Posted on October 23, 2024 by Zach

Often in PostgreSQL you may want to select a timestamp without the seconds. You can use the date_trunc() function with the following syntax to do…

Uncategorized

PostgreSQL: How to Convert Text to an Array

Posted on October 23, 2024 by Zach

Often in PostgreSQL you may want to convert a text column to an array. You can use the string_to_array() function with the following syntax to…

Uncategorized

PostgreSQL: How to Select Random Row from Each Group

Posted on October 23, 2024 by Zach

Often in PostgreSQL you may want to select a random row from each group in a table. You can use the following syntax to do…

Uncategorized

PostgreSQL: How to Swap Column Values

Posted on October 22, 2024 by Zach

Often in PostgreSQL you may want to swap the values of two columns. You can use the UPDATE statement with the following syntax to do…

Uncategorized

PostgreSQL: How to Select Columns by Position

Posted on October 22, 2024 by Zach

Often in PostgreSQL you may want to select columns based on their position. You can use the following syntax to do so: SELECT col2, col4…

Uncategorized

PostgreSQL: How to Count Number of Words in String

Posted on October 22, 2024 by Zach

Often in PostgreSQL you may want to count the number of words in a string. You can use the following syntax to do so: SELECT *,…

Posts pagination

Page 1 Page 2 … Page 90 Next Page

Search

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