let's take a table called users like this id name ... path 22 John ... 2/8/11/22/ 23 Mark ... 1/3/9/15/21/23/ where the path rapresents the hierarchy parent-c
I've seen a similar solution on this site but it's not usable in a view due to variable use limitations: Generating Sequence for Each Group in MySQL A table s
I am using a PIVOT to combine two rows with the same ID into a single row: SELECT B1_ALT_ID, B1_CHECKLIST_1, B1_CHECKLIST_2 FROM B1PERMIT A JOIN BCHCKBOX B ON A
I have an interesting problem to find the root cause. Inner join 2 tables on 2 columns, but the results are not expected. The data types for both columns are th
I have a home search table with have a city column which can have multiple cities like "Avignon, France|Nantes, France|". Addresses are "|" separated. There's a
I have table that is in the following format: Number Departing Arriving Departure Time Removal Indicator 1 Miami Dallas 1 PM N 1 Chicago Dallas 3 PM Y 1 Dallas
I declared a variable @avgMis as a decimal(2,2) in SQL Server. Then I tried to divide two integers, expecting a decimal value. Instead my answ
Using PL/SQL I have a TIMESTAMP(6) like this: 21-APR-22 02.25.00.000000 PM. I need to convert it to format YYYY-MM-DD HH24:MI:SS (EX: 2022-04-21 14:25:00). EDIT
I'm fairly new to BQ SQL and am stuck on a query regarding dates. I have a table that consists of customer_id (int), date_purchase (date), sales (int). The quer
I want to make some view but with condition in my fourth column. CONDITION: If epr.j_id is not null then fill lj.id BUT WHEN epr.j_id is null then fill 'NONE'
I am trying to run my code and I get the following error: Failure/Error: Bookmark.new(id: res[0]['id'], title: res[0]['title'], url: res[0]['url']) IndexError:
My date column "timestamp" is currently listed as: 2020-11-16 20:27:38.033 +0000 It's formatted as timestamptz and I've tried every search on here and google to
Using a SQL query to subtract in same table: Table1 grade record total_amount ------------------------------ DSP receipt 17258 DSP sales 16
Below is the existing T-SQL code which generates table data in JSON format just by using the keyword FOR JSON PATH, include_null_value. How to implement the sam
Hi I am looking for a SQL Script the can pivot the following table Every values in ObjectClassProperty column must become columns. ObjectInstanceProperty will
I am working with the employees table in SQL and I would like to fetch the data for max count of employees SELECT (COUNT(emp_no)) AS emp_count, dept_no FROM de
how to use MULTISET to map only one row rather than a list of rows. Classes: class User { private Integer id; private String name; private Integer p
select rooms from users where username='test_user'; **returns** {"roomID":[{"1":"test1"}]} I want to add to[{"1":"test1"}] this {"2": "test2"} --> [{"1":"t
I am trying to insert into a table, whose values are same except few from the same table with max sequnce number based on an ID. insert into ENT_ROLE_USERS_HIST
I am trying to get the total sum from columns of a specific data type(money) for multiple tables in a database. Currently I am able to get the list of columns f