Skip to content

Instantly share code, notes, and snippets.

@shofetim
Created May 14, 2013 23:39
Show Gist options
  • Select an option

  • Save shofetim/5580619 to your computer and use it in GitHub Desktop.

Select an option

Save shofetim/5580619 to your computer and use it in GitHub Desktop.
SELECT MAX(LENGTH(barcode)) FROM barcodes_barcode; --> 25
SELECT MIN(LENGTH(barcode)) FROM barcodes_barcode; --> 5
SELECT AVG(LENGTH(barcode)) FROM barcodes_barcode; --> 11.1520790674610021
SELECT DISTINCT LENGTH(barcode) FROM barcodes_barcode; -->
length
--------
8
15
25
13
5
11
14
17
12
10
9
6
(12 rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment