where clause and aggregate functions
Deposit(accno,cname,bname,amount) Question:List the name of customer having max deposit in branch B1. Answer: Select cname from Deposit where amount in (select max(amount) from deposit where bname='B1'); IS THE ANSWER CORRECT?IF NO,PLEASE POINT ME OUT THE MISTAKE AND EXPLAIN THE CORRECT ANSWER FOR THIS. Thank You.
It is correct but it will probably be slow on a large dataset and if you don't have indexes on amount and bname. I would rather use something like SELECT cname FROM Deposit WHERE bname='B1' ORDER BY amount DESC LIMIT 1;
use aggregates (min, max, avg) in CONSTRUCT query [duplicate]
R: transposing and aggregating columns
SQL Query Aggregate Error
Usage of aggregate functions in MarkLogic
Querying customDimensions in Google Bigquery
NHibernate - QueryOver criteria appearing in Where instead in Having clause, error
Howto aggregate on full data set in Spring Batch jobs?
Creating an aggregate function fails
Necessity of declaration of function in c and cpp
Calculate window average in tableau
Complexity asymptotic relation (theta, Big O, little o, Big Omega, little omega) between functions
What are TOP_COUNT and TOP_MAXCOUNT in BigQuery?
marklogic need advise for approach to aggregate documents
multiply(num) aggregate function in postgresql
Binding the Result of an Aggregate Function to a Projected Variable
tableau aggregate data based on dimension