When I run the command below, there is a syntax error highlighted at UNION on the last line. I am really not sure why. I verified parentheses and c ...
When I run the command below, there is a syntax error highlighted at UNION on the last line. I am really not sure why. I verified parentheses and c ...
I have a table tab1 in timescale db which has 3 columns tag, time, value. time and tag make up the pk for the table: (time, tag). There are more than ...
I need some help here, my request is : List the bookID and number of copy of this in Library (Number of copy in library = number of copy – number of c ...
How do i perform a where action on a newly created field that is populated with the values of two fields? ...
I am dealing with a problem in Postgres, where I have table ORDERS with column RECEIVED_AT and table CURRENCY_RATES with column VALID_FROM. There are ...
this keeps returning null when it should give me back 200. same thing if I do --> https://www.postgresql.org/docs/current/functions-json.html ...
We're having some logic to detect duplicate posts in out system. The query looks similar to this: What would be the way to replace this lateral joi ...
I have one table (Bigquery), which has ', ' separated values in two columns: For each tag_id is 1:1 matched with a tag_name. I want to split the co ...
I have a WITH statement which returns a table like followings: id parent_id 1 null ...
I am using to this query to convert raster values into vector data ; this resulting on As my raster data contains other bands and I want to ret ...
Oracle 18c: I have mapping software that has a limitation where it can only handle a single geometry column per table. If there are multiple geometry ...
this is my current code: How to convert the same to SQL server code? Because I can't find Cross join lateral in SQL server. ...
I have these 6 tables and query which returns everything I want, but I want to add a new pivot table, so I can get a list of rows linked to it. Query ...
I would like to join a 'conditioned subquery'. Let's imagine that we have a table with certain data containing an ID, a created TS and some or one val ...
I have the following tables: user_id is the foreign key on the user table. In the points table, each user can have multiple entries, for instance: ...
I have following SQL statement: What I want.. If conversion_type = re-engagement then first row in CROSS JOIN LATERAL should be ('conversions'::tex ...
I have the following lateral join that I am trying to migrate to Snowflake from Postgres I am getting the following error in Snowflake - There a ...
I have a two tables colors and color_translations with structure like this: colors id created_at updated_at ...
I am trying to create a timeseries and a lag of it at the same time using lateral: For some reason I get ERROR: column "ts" does not exist. What is ...
I have this view in Snowflake: And this user-defined table function: The following query works, and returns 3 rows: However, I didn't expect ...