Created
May 23, 2020 02:15
-
-
Save brito/1b64ba2093dc43869bb6f1f6b84d2daf to your computer and use it in GitHub Desktop.
Simple ASCII bar visualization of a single quantity
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 characters
/* | |
Simple ASCII bar visualization of a single quantity | |
eg */ select * from _bar(53); /* | |
*/ | |
create function _bar(_quantity int, _glyph text = '■') | |
returns text as $$ | |
select repeat(_glyph,_quantity/3) || ' ' || _quantity | |
$$ language sql immutable; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment