Skip to content

Tag: postgresql

postresql query to check no. of documents is 4

I have a master table for applications and another table for documents upload, I want the count of applications which has 4 documents in document table. master application table=>application_ht_install and Documents table=>bescom_appl_upload_doc ack_no is the primary key for application_ht_install and f…

psycopg2 takes a value as a column

I’m trying to create a table using psycopg2 and then insert outer data from some jsons. For this reason I defined 2 function: create_words_table() and insert_data(): So, attempting to execute them: I got further error: Looking at documentation, I don’t see any mistake applying simple INSERT query …

How to deal with JSON column while using GROUP BY

I’m using a query similar to the below one, address is JSON TYPE. But getting below error: I’m trying to get the data of a person who has the max salary for his age and I need to include adress filed which should be JSON So, Is the there any way to achieve this or is this practically possible ?

Follow the connections : recursive query

i have two columns of numbers. the goal is starting from a number f.e. 55, to extract all ‘connected’ numbers (starting with any of those numbers, should yield the same result) in this case all numbers shown here : 55,56,35,69,60,22,47,2,26 I use the following query : but I get back only those bac…

INNER JOIN and Count POSTGRESQL

I am learning postgresql and Inner join I have following table. Employee Department I want to query to return the Department Name and numbers of employee in each department. I dont know what I did wrong as I am new to database Query. Answer When involving all rows or major parts of the “many” tabl…