Skip to content
Advertisement

Tag: subquery

Using WITH and subset in CASE construction

Greetings to senior colleagues. I got caught up in this thing. It is necessary to substitute the corresponding values in the CASE when the construction depending on the state of the load_date field. The problem is that the second was assigned a value to the mean_v field based on the calculation of the average mean_v obtained for the subsample. how

SQL Combining MAX and SUM

So I have one SQL table that contains the below columns: There are ~2800 unique License numbers and will have numerous FundsIn each day. I am trying to find the last date there was activity (ActivityDate) and the sum of all of the FundsIn on that MAX ActivityDate. Below is a query I’ve been trying to modify to get it

Trying to make a new table by pulling data from two tables and keep getting ‘Error: Every derived table must have its own alias’ on this query

I have an ‘Orders’ table and a ‘Records’ table. Orders table has the following columns: Records table has the following columns: I’m trying to pull and compile the following list of data but I keep getting an error message: Here’s my query: What am I doing wrong? Answer The subquery in the join needs an alias. It also needs to

Delete with inner join and trigger throw error: Can’t update table ‘table_b’ in stored function/trigger

Why the following error (Can’t update table ‘table_b’ in stored function/trigger because it is already used by statement which invoked this stored function/trigger) appears after i try to delete with inner join? Can i solve it? Answer I don’t see the point for a trigger here. The functionality you want can be achieved by just adding the on delete cascade

SQL – WHERE NOT EXISTS [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I have a table with employees ID NAME SALARY and I am getting the employee with the most salary with this SQL statement: as I

Advertisement