Skip to content
Advertisement

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 foreign key for application Documents. And doc_id is for the document id, Help me out guys the above query gives

Is NamedParameterJdbcTemplate vulnerable safe?

We are using NamedParameterJdbcTemplate to achieve “IN” operator functionality. Is there any SQL Injection vulnerability when we use NamedParameterJdbcTemplate? Answer Since NamedParameterJdbcTemplate internally use PreparedStatement for querying , and if you can make sure that you do not build the SQL query by somehow concatenating the input from the user , but using the placeholder :xxxx to specify their value,

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 and can’t understand why psycopg2 takes a tuple after word VALUE as a

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 back : 55,56,35,69,60,22,47 I think using this will

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” table, it’s typically faster to aggregate

Advertisement