This file contains 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
-- Functions to create and draw histograms with PostgreSQL. | |
-- psql> select * from show_histogram((select histogram(length(email), 0, 32, 6) FROM auth_user limit 100)); | |
-- bucket | range | count | bar | cumbar | cumsum | cumpct | |
-- --------+-------------------------------------+-------+--------------------------------+--------------------------------+--------+------------------------ | |
-- 0 | [0,5.33333333333333) | 1 | | | 1 | 0.00273224043715846995 | |
-- 1 | [5.33333333333333,10.6666666666667) | 5 | = | | 6 | 0.01639344262295081967 | |
-- 2 | [10.6666666666667,16) | 149 | ============================== | ============= | 155 | 0.42349726775956284153 | |
-- 3 | [16,21.3333333333333) | 145 | ========= |
This file contains 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
SELECT actual, cheflieu, cdc, rang, reg, dep, com, ar, ct, modif, pole, | |
tncc, artmaj, ncc, artmin, nccenr, articlct, nccct | |
FROM insee_cog.france2016 WHERE subst(dep,1,2) <> substr(pole,1,2); | |
actual | cheflieu | cdc | rang | reg | dep | com | ar | ct | modif | pole | tncc | artmaj | ncc | artmin | nccenr | articlct | nccct | |
--------+----------+-----+------+-----+-----+-----+----+----+-------+-------+------+--------+------------------+--------+------------------+----------+------- | |
2 | | | | 32 | 02 | 285 | | | 1 | 59545 | 1 | | ESCAUFOURT | | Escaufourt | | | |
3 | | | | 24 | 28 | 131 | | | 1 | 91016 | 0 | | DOMMERVILLE | | Dommerville | | | |
2 | | | | 27 | 39 | 012 | | | 1 | 25527 | 1 | | ANTORPE | | Antorpe | | | |
2 | | | | 44 | 51 | 4 |
This file contains 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
-- Open These views with QGIS | |
-- You can label the ticks view with this expression : "CASE WHEN m % 5 = 0 THEN h END" to get hour numbers | |
-- Set categorized styles on typ and unit to set different styles for dials, and for the hands | |
-- Please tweet your best clock designs with #PostGISClock hashtag | |
create or replace view ticks as | |
select | |
m as id | |
, case when m % 5 = 0 then 'h' else 'm' end as typ | |
, m / 5 as h |
NewerOlder