This message was deleted.
# help
s
This message was deleted.
m
The anti-SQL-injection rules of the SQL cell don't allow you to inject code (like column names) like this, only values (like your limit example)
You could select both columns, and the apply the choice in downstream JS cells.
you could also use the more low level interface that doesn't include those anti-injection rules. You'd make a JS cell that looks something like this:
Copy code
pickedRows = pizzeriaDB.query(`select ${pickColumn} from stores limit 10`)
z
Interesting. A use-case I had was wanting to define some column/columns to group by and get their value counts. So this would word for defining a single column to count up the results.
Copy code
pizzeriaDB.query(`select ${pickColumn}, count(*) as count from stores group by ${pickColumn}`)
m
That should work, yeah
z
Looks like this is doing what I wanted: specify columns, get back the counts of them grouped up.
m
you could then add a data table to get a nice visual of the output like the SQL cell gives:
z
Lovely, thanks for the help! ◆