1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 23:28:02 +00:00

Add sql tags to the code blocks.

This commit is contained in:
jbranchaud
2015-05-09 11:45:47 -05:00
parent 6695f37cbb
commit 24fb4030b0

View File

@@ -2,7 +2,7 @@
Assuming I have a database with a posts table: Assuming I have a database with a posts table:
``` ```sql
> select * from posts where id = 1; > select * from posts where id = 1;
id | title | content id | title | content
----+----------+------------------------------------ ----+----------+------------------------------------
@@ -11,7 +11,7 @@ Assuming I have a database with a posts table:
I can compute the word count of the content of a given post like so: I can compute the word count of the content of a given post like so:
``` ```sql
> select sum(array_length(regexp_split_to_array(content, '\s+'), 1)) from posts where id = 1; > select sum(array_length(regexp_split_to_array(content, '\s+'), 1)) from posts where id = 1;
sum sum
----- -----