I’ve turned off adding quotes in the settings: .withRenderQuotedNames(RenderQuotedNames.NEVER) But when I check the SQL log I still find double quotes in the output. jOOQ adds it to function calls: …
How to check if any string in array contains any other string (substring) in other array? (PostgreSQL)
I’ve got 2 string arrays, and I wanna to compare if any string of first array – contains SUBstring from other one, which storing these SUBstrings. In other words: I don’t wanna compare these arrays …
How can I print or put to some HashMap or anything else my result of query?
I have an SQL query in the following Java Code: try { Statement st = conn.createStatement(); try { st.execute(“SELECT * FROM students WHERE course_id =1”); } finally { // …
A constraint with function that contains Select is never satisfied
I have a table like this: And I need to forbid any rent time intersection for the same car. I found that, when a function is used (example below) inside the constraint, the value it returns is different from whent it is used outside the constraint. So when I’m trying to insert data into the table, the c…
Confused with Join logic
I find it so confused that my simple logic doesn’t work. I have a data with 2 columns ID and code. 1 ID can link to multiple code. So the sample data is like this: The rule is that: Find ID that has code = 1 AND code not equal to 2 AND code =3 So clearly a is fail,
Update records in table from CTE results
I want to update the records in my table using CTE. And I’ve been trying with the insert function using CTE and it’s working. This is my query with the insert function: How to change that with the update function? i want to change to update function because when i use insert function,the previous …
Why am I getting “Invalid input syntax for type integer” in postgresql when importing a CSV?
I’m trying to import a .csv file to my postgresql DB. I created a table as follows: Then I used the following command to import the .csv file And my .csv file contains the following: However, this doesn’t work and the following message appear: Answer Maybe there is a BOM in the CSV? hexdump the fi…
Why am I getting a an error when creating a generated column in PostgreSQL?
CREATE TABLE my_app.person ( person_id smallserial NOT NULL, first_name character varying(50), last_name character varying(50), full_name character varying(100) generated always as (…
SQL query joining two different tables. Find online status from user’s last interaction
Problem description: Finding online status of therapist users based on last interaction in Session table. Cannot keep last interaction date on User table but it should be separated on Session table. But how can I join one row for each user with User table information and session data of Session table for user…
calculate average for group based on element value
I have a table with 2 columns: Model and Price Model Price Pilot 30 Civic 20 Highlander 10 Corolla 40 Rav4 25 I know that Pilot and Civic is Honda car while Highlander, …