Skip to content

Commit 4be44b4

Browse files
authored
fix the query to ignore nulls (#1738)
1 parent 92670c6 commit 4be44b4

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/sql.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,12 @@ Plot.plot({
174174
marks: [
175175
Plot.axisY({tickFormat: (d) => d / 1000, label: "count (thousands)"}),
176176
Plot.rectY(await sql`
177-
SELECT
178-
FLOOR(phot_g_mean_mag / 0.2) * 0.2 AS mag1
179-
, mag1 + 0.2 AS mag2
180-
, COUNT() AS count
181-
FROM gaia GROUP BY 1
177+
SELECT FLOOR(phot_g_mean_mag / 0.2) * 0.2 AS mag1
178+
, mag1 + 0.2 AS mag2
179+
, COUNT() AS count
180+
FROM gaia
181+
WHERE phot_g_mean_mag IS NOT NULL
182+
GROUP BY 1
182183
`, {x1: "mag1", x2: "mag2", y: "count", tip: true})
183184
]
184185
})

0 commit comments

Comments
 (0)