Details: V and C are tables I want C to join V on 2 conditions(two C are named C0 and C1). Since I must filter V by columns of C and C’s child tables separately in the same query, I think joining is …
SQL Query Sum, Multiply and combine 5 tables then group
I’ve created my table. I’m trying to craate a query that multiply and add sold_quantity from sold table and sale_price from on_sale table and called it R1 for now, and retail_price from product table …
JSONB column does not exist
I got this error. ERROR: column “name” does not exist LINE 6: SELECT JS, location, location->>Name ^ SQL state: 42703 Character: 278 from this query …
sql – Is there a way to filter through the results of a SELECT query, with another SELECT query?
Specifically, what I am trying to do is rank a table by a column value, referred here as power, and then take that ranked table and find a specific row, or a user in this case. Much like what would be …
Get column name of Table based on query
I have this SQL query Query And this is my table let’s say Tree_table So I want my output to be Is this possible using SQL query or even PHP will do Answer You need to unpivot the data. In MySQL, this is probably most easily done with union all:
Oracle not auto-generating primary key on insert
New to Oracle here. I have a table created with the following SQL: create table Widgets ( id integer constraint pkWidgets primary key using index, ruleId integer not …
Finding employees who are not managers
I have a table where we have staff_id and manager_id. Attached screenshot. I found managers by using this query: select e.first_name as employee , m.first_name as manager from sales.staffs E inner …
SQL server: How to Modify a JSON element value in a nested JSON array
If i have below JSON (@CarDataJsontest) e.g { “house”: { “gate”: [ “Car1”, “Car911”, “Car3”, “Car4” ] } } If i need to do is to modify the car911 to car2 all i …
sql – group by using dynamically selected table names
I have a table called app_to_tables which is mapping between apps and table names, table names are around 20, so I cannot hard code them in the query. Here for simplicity I put just 2 table names (…
Identify a column where data has been entered multi line
Oracle Database 11g Enterprise 11.2.0.4.0, PL/SQL Release 11.2.0.4.0 I have a Table, which contains an address column (NVARCHAR2(50)). This column is supposed to be line 1 of the address only. There …