Skip to content

Tag: postgresql

knex postgres join as nested JSON

I’m using knex with postgresql db, I have a row in table A which has one-to-one relation to rows in table B and one-to-many relation to rows in table C. I wanna join a row from A with B and C and get a json like Where stuff like aCol means column from table A, bCol – column from table

insert statement in postgresql

I have a table with 8 records. I have 4 records for Dec-17, same 4 records for Jan-18 (only yearmon changes) I am trying to have same records for the month of Feb-18 as well. All the column values …