I have the following sql: Which gives me (as expected): 789019 | 789019 Now, I need to parameterize the query but am unable to: I get an empty row and that’s because it is literally searching for “$1”. I try to remove the double quotes then it complains I’m not sure how to resolve this one. Answer If you just
Tag: postgresql-9.5
SQL – create SQL to join lists
I have the following table: Add Data: Find users who share addresses. Expected Results: Question: How do I formulate a SQL query to obtain the expected result? Much appreciated. More info: PostgreSQL 9.5.19 Answer I don’t know if this is the most efficient method, but I can’t come up with something better right now. I assume this will have a
Postgres Function not working when I have a large result
I’m copying information from table 1(tmp_subtype) to table 2(subtype_user). I have a test table 1 with 15 registers. I run this function into postgres: CREATE OR REPLACE FUNCTION …
How to get particular object from jsonb in PostgreSQL?
I have a table called ‘Test’ that holds two fields ‘qnId’ and ‘Answers’. ‘qnId’ stores a uuid and ‘Answers’ is a jsonb array that roughly looks like this: [{ “user” : “1”, “ans” : “some text” }, { “…