Skip to main content

max / makenotwork

938 B · 33 lines History Blame Raw
1 {
2 "db_name": "PostgreSQL",
3 "query": "\n SELECT\n COALESCE(SUM(CASE WHEN status = 'completed' THEN amount_cents ELSE 0 END), 0)::BIGINT AS \"revenue!\",\n COALESCE(SUM(CASE WHEN status = 'completed' THEN 1 ELSE 0 END), 0)::BIGINT AS \"completed!\",\n COALESCE(SUM(CASE WHEN status = 'refunded' THEN 1 ELSE 0 END), 0)::BIGINT AS \"refunded!\"\n FROM transactions\n ",
4 "describe": {
5 "columns": [
6 {
7 "ordinal": 0,
8 "name": "revenue!",
9 "type_info": "Int8"
10 },
11 {
12 "ordinal": 1,
13 "name": "completed!",
14 "type_info": "Int8"
15 },
16 {
17 "ordinal": 2,
18 "name": "refunded!",
19 "type_info": "Int8"
20 }
21 ],
22 "parameters": {
23 "Left": []
24 },
25 "nullable": [
26 null,
27 null,
28 null
29 ]
30 },
31 "hash": "47f812f064646e71a3b0095e4c5587ce322c273c2fcdeb271eee21c6a9c83095"
32 }
33