I am trying to use a Global Temporary Table with CTE in Firebird SQL, but I'm not sure how. Below is sample code of what I am trying to accomplish C ...
I am trying to use a Global Temporary Table with CTE in Firebird SQL, but I'm not sure how. Below is sample code of what I am trying to accomplish C ...
I am still learning many new things about SQL such as PARTITION BY and CTEs. I am currently working on a query which I have cobbled together from a si ...
I'm having great difficulty writing this query and cannot find any answers online which could be applied to my problem. I have a couple of tables whi ...
I am confused about how to fix it; can anyone help me? How can I fix 'on'? I already tried but I don't know how I can join on the primary key ...
Here's my code, to traverse all nodes starting from one: With input 47894, it gives: What if I need the reverse? ...
I have a table with a varchar(max) column that stores JSON data and one of the records has an extra comma at the end of an array in the JSON. The foll ...
I have a table named concept_has_parent_concepts with concept_ids and their parent_ids, the concept_ids are actually the child_ids pointing to their p ...
I've got various kinds of same queries all over my project which is a hell to maintain. So i was thinking to re-organize them all in one place. I'm ne ...
What I mean is this. In PostgreSQL (v 15.1) I have a table foo created in the following way. create table foo ( id integer primary key generated by ...
app_id status modified_date 1 A 2022-10-23 1 B 2022-10-10 ...
I have a table like date ticker Action '2022-03-01' AAPL BUY '2022-03-02' ...
Details These are my tables and data: To get a count of picked Items, I run this query: select item, sum(op.quantity) as quantity from orders o l ...
I have [dbo].[fn_GetUserPublications] function which return information about User's publications. It returns fields like Title, Desctiption, CreatedD ...
I'm still having trouble understanding how CTE works. I'm looking to make an insert. In case of conflict I use the on conflict do nothing but I want ...
I came across an interesting piece of SQL code in a view today where a CTE was being used to hold constant values used within sub-queries. It made rai ...
I am using this code to see the unique results of concated/joined columns 'a,b' from table1 and is working perfectly But, instead of writing like ' ...
I have checked this answer which is similar to my problem. I have a query which ran on previous SQL server, now that whole database is migrated to Azu ...
Common recursive CTE looks like: WITH RECURSIVE cte AS ( SELECT 1 id UNION ALL SELECT id + 1 FROM cte WHERE id < 1000 ) SELECT COUNT(*) FROM ...
I need to build a sql query to find the least expensive squad (salary-wise) for teams in a European volleyball league. For each team, the squad consi ...
What would I need to do to achieve the following? Somehow I can't seem to find a good solution. I have a few CTEs, and the last one is producing just ...