Last active
September 16, 2022 15:11
Revisions
-
karanlyons renamed this gist
Jan 23, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
karanlyons revised this gist
Dec 28, 2015 . 1 changed file with 8 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,10 @@ UPDATE <TABLE> SET <COLUMN>=<RANGE_TYPE>( lower(<COLUMN>), -- Swap out for actual value upper(<COLUMN>), -- Swap out for actual value concat( CASE WHEN lower_inc(<COLUMN>) THEN '[' ELSE '(' END, CASE WHEN upper_inc(<COLUMN>) THEN ']' ELSE ')' END ) ) WHERE <CONDITION>; -
karanlyons created this gist
Dec 21, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ UPDATE <TABLE> SET <COLUMN>=<RANGE_TYPE>( lower(<COLUMN>), -- Swap out for actual value upper(<COLUMN>), -- Swap out for actual value CASE WHEN lower_inc(<COLUMN>) AND upper_inc(<COLUMN>) THEN '[]' WHEN NOT lower_inc(<COLUMN>) AND upper_inc(<COLUMN>) THEN '(]' WHEN NOT lower_inc(<COLUMN>) AND NOT upper_inc(<COLUMN>) THEN '()' ELSE '[)' END ) WHERE <CONDITION>;