Skip to content

Tag: sql

many to many relationship knex js

I am trying to fetch data from the database in this way: I want all the templates and those templates have an array of categories in it so the methode I am currently using currently I am doing this but the object doesn’t seem to alter. Answer You are not waiting for the promises to resolve. You should d…

Grouped aggregate counts for each date in a series of dates

I am trying to get grouped task counts by state over a series of dates using the following tables: There isn’t a consistent daily “state” record for each task because task_logs only has entries for when a task changes state. This means I have to get the last “state change” log fo…

How to add a vector to a table in backend using dbplyr (R)

I created a table from a data source using tbl(). I need to add a column including 1:nrow() to my dataset and tried different methods but I didn’t succeed. My code is as below: It doesn’t add column ID to my dataset and only adds column step. Using as.data.frame(), it works but so slow. Do you hav…