This is how my query is structured but the loop is running infinite times. I am referencing a single table twice. this is the expected output ...
This is how my query is structured but the loop is running infinite times. I am referencing a single table twice. this is the expected output ...
I'm giving one example -- sub-query -- cte but I'm also wanting the answer in overall case. In some cases it may depend on the dataset and obje ...
I have the following 2 collections: Uploads Files I want the output as a join operation of both the collections which contains all pending docu ...
Trying to update in MongoDB nested object Document Need to update the child id to 13 whose name is "aa", O/P, which I am trying to get ...
This is what is displayed when I tried to execute the SQL statements: "Each function argument is an expression, not a query; to use a query as an expr ...
I'm trying to get all the items of the cart_items and add it to the ticket_items. I've the error "SUBQUERY RETURN MULTIPLE ROWS", but that's what I wa ...
Question: How do I fix this? Tried casting and all sorts of tricks but nothing seems to fix it while keeping the table the same. Bonus Question: Why ...
I am looking to find the sum of the current + the last X Nth Rows. I am able to do this with the following query, however it is not very scalable. ...
I am struggling to solve one problem that the best if would be fixed using SQL instead of python/bash scripting. The idea is to calculate the time dif ...
I am using SQL-Server. I want to run a nested query, get the results and do two inner joins on the complete nested query results. My nested query is ...
I have a table with 3 columns namely- Business function, Hosts and It Services. A business function owns multiple hosts and each host has multiple ser ...
I need to write a SQL query to find the faculty which has taught every subject (ie Sam) With nested queries Without using aggregate functions (n ...
In the given code, we give the subquery the alias of station_num_trips - I'm unable to understand why this is given since it isn't referenced in any o ...
I've read that nested queries can potentially slow down the overall query, and was wanting to know a way to avoid this in my code. I am basically want ...
I'm self learning SQL, using Microsoft Server management and have a question Let say you have Customer table, Store table and Delivery table. The stor ...
I have a few tables that I'm joining and one of them can have an unknown number of matches, up to 6. Each match should be returned as a row value in t ...
I have the following Menu Model with a nested structure: This model is resolved as follows: It works as requested until I needed to apply some r ...
The schema is as follows: Now, I want to find out the number of games developed by an American for each category. It must show 0 if no American has ...
Consider the following schema: Now, if I want to find the most common interest of users (the interest with largest number of users), how would I do ...
Keeping in view the above picture I want to run my query until the $orderQty is met. In the picture the upper table is of products and the lower tab ...