Skip to content

Convert oid to json as int instead of string

Using Postgres 12, the following will return an int JSON representation: > SELECT to_json(2::int) .. 2 Whereas if the type is oid, it will return it as string: > SELECT to_json(2::oid) .. “…

Error in SQL syntax [function in node-red]

I’m trying to post the data into database through node-red but I got this error. “Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘insert into customizations(custom_id, product_id, pa…

How do i transpose and grouping in PL/SQL [ORACLE]

I have this table: USER DEP USER1 DEP1 USER2 DEP2 USER3 DEP2 USER4 DEP3 But i want to transpose it and group user under DEP. DEP1 DEP2 DEP3 USER1 USER2 USER4 USER3 NULL NULL What i have tried following pivot query. The output is: 00933. 00000 – “SQL command not properly ended”. How do i use …

Put a json inside another json on Oracle 19

i have the next problem. I need create a json from a table that contain another json inside in one of the columns Having this: i try with this query: But the result is not correct: Must be something like: There is a way to get the correct result? Regards. Answer after see examples and see the resuslts. I know

Full Join on two tables with criteria on both

I have two tables with a matching key. Some records exist on both tables, others only exist on one or the other. What I cannot for the life of me figure out is how to add criteria to both tables when …

Dynamic Case Expression Based on Dates

I have a SQL query that has multiple conditions that will change the WHERE clause. I have three case expressions that dynamically update this WHERE clause. The last two case expressions are working …